Showing posts with label jar. Show all posts
Showing posts with label jar. Show all posts

Saturday, 23 April 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.

Thursday, 7 April 2011

Create JAR file using Eclipse IDE

reating JAR file using Eclipse IDE is pretty much easy. Follow the simple steps.
Right click on your project, which you want to create a JAR file of. And select Export from the context menu.

Select JAR file from Java folder and click Next.


Provide the Destination path and click on Finish to create the JAR.