Home arrow static arrow Java Programming [Archive] - having trouble importing a .jar in eclipse...
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - having trouble importing a .jar in eclipse...
This topic has 2 replies on 1 page.

Posts:1
Registered: 7/22/04
having trouble importing a .jar in eclipse...  
Aug 2, 2004 1:21 PM



 
hi everyone, i got an easy question that needs answerin asap... they're making me use eclipse at work and it's only my second day using the ide. for the life of me i can't seem to import a .jar file i need for a project. i tried right clicking on my project name in the package explorer and right-clicking on my project, selecting import and picking zip. i choose the .jar file i need and everything seems to have been imported correctly, but when i type in the "import com.name.of.class" command in my source, the ide says "not declared"... i dunno, but the classes that got imported all have like a white target looking icon next to their names. any help would be appreciated, thanks
 

Posts:343
Registered: 7/13/04
Re: having trouble importing a .jar in eclipse...  
Aug 2, 2004 1:23 PM (reply 1 of 2)



 
Its easier to just place the files where the rest of the library files are yourself, I had the same problem when I first started out. I don�t know about you, but my library files are all in the directory: c:/ Program Files/java/j2re_number/ext. let me know if it works., It also shouldn't have a white target, that means the package is empty. when the package is full it looks brownish.
 

Posts:6,750
Registered: 1/25/04
Re: having trouble importing a .jar in eclipse...  
Aug 2, 2004 2:05 PM (reply 2 of 2)



 
Yucky, you shouldn't add jar files to the JRE lib directory. Instead, go to Project -> Properties -> Java Build Path -> Libraries tab and add the jar (Add Jars button if the jar is within your project or Add External Jars if not). Those options may vary slightly depending on your version of Eclipse, but that's the general idea.
 
This topic has 2 replies on 1 page.