Results 1 to 4 of 4
  1. #1
    liber77 is offline Member
    Join Date
    Dec 2011
    Posts
    3
    Rep Power
    0

    Default how to know which jars the import commands are dependent on

    If you have some import statements in the beginning of a .java file, how do you know which .jars you have to use when you compile?

  2. #2
    kevinn205 is offline Member
    Join Date
    Nov 2011
    Posts
    65
    Rep Power
    0

    Default Re: how to know which jars the import commands are dependent on

    Do you compile by hand program or IDE or application?

    Java can come with alot of the stuff like import javax.swing.JFrame etc no need to specifitly compile them with IDE's, if you looking at doing it by hand ill let someone more qualified answer

    if your looking to compile useing a IDE i would reccomend using eclipse all you have to do is specify where the jar is located and it adds it to the library,
    whenever you create a executable jar it compiles all the necessary ones that you located, anytime you use a outside source your gonna need to locate it

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default Re: how to know which jars the import commands are dependent on

    The document should explain that. If you are using a third party JAR file, then you have to add them into the class path before import into your class. (I am talking with relevant to use of the command prompt and simple text editor.) If you are using an IDE it will done the job for you, and simply what you have to do it point them to the IDE.

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default Re: how to know which jars the import commands are dependent on

    Quote Originally Posted by kevinn205 View Post
    if your looking to compile useing a IDE i would reccomend using eclipse all you have to do is specify where the jar is located and it adds it to the library, whenever you create a executable jar it compiles all the necessary ones that you located, anytime you use a outside source your gonna need to locate it
    Exactly what I want to point. But I have one recommendation. When you are doing this import all the JARs as global entity, rather project specific. Hope Eclipse could do it.

Similar Threads

  1. Replies: 0
    Last Post: 03-03-2011, 02:20 PM
  2. Replies: 0
    Last Post: 08-07-2009, 11:00 AM
  3. Platform dependent File Path....
    By sanjayksaini in forum Advanced Java
    Replies: 7
    Last Post: 11-30-2008, 03:12 AM
  4. Replies: 0
    Last Post: 08-19-2008, 04:44 PM
  5. ERROR: Can't find dependent libraries
    By baltimore in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 06:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •