Saturday, April 23, 2011

Adding external library (.jar ) to the Java classpath

The following describes how to add external jars to your project.
The following assumes you have a jar available.

Create a new Java project "ExternalJarTester". Create a new folder called "lib" (or use your existing folder) by right click on your project and selecting New -> Folder.


From the menu select File -> Import -> File system. Select your jar and select the folder lib as target.
Select your project, right mouse click and select properties. Under libraries select "Add JARs".
Eg. adding ant jar.

 Above thing can also be done by Configure build path in :
File->Build->Configure Build Path

Now Click Add External Jars and browse the external jar and add it.

No comments:

Post a Comment

Chitika