Wednesday, October 22, 2014

Adding jars, classes in eclipse

If you need to add JAR Files/Class files to your project in Java, it is very simple.

Follow below steps,

Right click properties of your project,

Select Java Build Path,

Select Libraries,

Add JAR's -> If you have the .JAR files within your project directory.
Add External JAR's -> If you have the .JAR files outside your project directory.
Add class files -> If you have the .class files within your project directory.
Add External class files -> If you have the .class files outside your project directory.


Do not forget to "Order and Export" the files that you have added before clicking OK or closing the dialog box.

Click "Order and Export" and select all those files that you have added into the libraries. Select Ok.

Now close the Dialogue box to save the changes.


Tip: If you are working on any type of projects, its better to add those jar's and class files into the project directory "/lib" and then give the appropriate build path of the project directory. It lets you do not misplace your libraries that belong to the project.

No comments:

Post a Comment