Monday, December 23, 2013

Eclipse: create a user library and add JAR files for a project

If there are many common JARs we want to use across several projects, we can create a User Library in Eclipse and add those JARs to it. Later when we are working on a new project which needs those JARs, we can simple add the User Library to the Build Path of the project.

To create a User Library with the JARs added
  1. Click Window on the menu bar and select Preferences.
  2. In the popup dialogue, choose Java->Build Path->User Libraries.
  3. Press the "New..." button, and input the User Library Name in the popup.
  4. Click "Add External JARs" button to add all the JARs we want to the library.
To add our User Library to the project
  1. Right click on the project.
  2. Select "Properties" from the menu.
  3. In the popup dialogue, select Java Build Path.
  4. Click "Add Library ..." button.
  5. Choose User Library from the list.
  6. Check the user library we want to add and click the Finish button.

No comments:

Get This <