JavaBeat
Eclipse Home Articles Tutorials Java Interview Questions & FAQs Java QnA Code Junction

Next : Import source code

Import third party JARs


If your application has a dependency on a third party library, you can import it into your project as a JAR file and add it to your project's classpath.

Say that the demo application needs to process dates, and we want to use the excellent Joda Time API.

First download a binary distribution of the library and extract it somewhere on your file system. Then create a new folder in your project as shown below:





When prompted, call the folder "lib". Right click on your new folder and select "Import..."




In the resulting dialog, select "File System" and then "Next". Browse to the location that you extracted the library to and select the JAR file.

Note that when you click "Browse" you must navigate to the directory containing the JAR file, otherwise you'll end up importing some unwanted folders as well as your JAR file.



Click "Finish". You should end up with something like:



Now to add the JAR to the project classpath. Right-click on the project and select "Properties". Go to the "Libraries" tab in "Java Build Path":



Click on "Add JARs..." and navigate to the freshly imported JAR. Click "OK"


Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
SCJD Tips
When we start a thread by applying start() method on it ,how does it knows that to execute run()method?
About Wrapper class in Java
How to configure weblogic 7.0 in MyEclipse?
Static Block and Static Initializer in Java

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat