Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Eclipse IDE and jar files

Thread view: 
Peter Parker - 28 Jul 2006 22:13 GMT
Hi,

 At work, I see a number of Java files that do not have the 'import'
statements (such as "import org.apache.commons.lang.StringUtils") and so
Eclipse IDE 3.1 gives context-sensitive error message like 'StringUtils
cannot be resolved on lines where StringUtils are implemented. Is there a
way (to set up the classpath?add jar files? create user library?) in Eclipse
IDE to reference the jar files (commons-lang-2.1.jar, for example) so that
the import statements are not needed? Could someone show me how? Thank you.
jagonzal@gmail.com - 28 Jul 2006 22:25 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> IDE to reference the jar files (commons-lang-2.1.jar, for example) so that
> the import statements are not needed? Could someone show me how? Thank you.

You could get rid of the imports if you use the FQN of every external
class in your code. Imports are cleaner.

The problem you describe is fixed by opening the project properties,
going to "Java Build Path", and selecting the "Libraries" tab. There
you can add your external jars, and the imports will actually work.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.