Tags

Jan 22, 2012

Add new Jar file to your project


Here are all the steps you need to take to add a new jar file to your Eclipse build path:
  • Outside of Eclipse, copy the jar file you need to your project's jar file folder . Most projects have a lib folder for their jar files, so I'll assume that's where we're going to add it.
  • In the Eclipse Package Explorer, select your project, and then press the F5 key to refresh your project. (Alternatively you can just select the lib folder, and refresh it.)
  • Now when you look at your lib folder you'll see your new jar file in there.
  • Next, right-click that jar file, then select Build, and then Add To Build Path.

 
A few other notes about adding a new jar file to your Eclipse build path:
  • If you prefer using the menu system, you can add your jar file to the Eclipse Build Path like this: select Project, then Properties, then Java Build Path, then Libraries, and finally Add Jar.
  • To refresh your project view in the Eclipse Package Explorer, you can either press the F5 key, or right-click the project and select the Refresh menu option.
  • As mentioned above, it can be faster to just select your lib directory and refresh it.


That's all you have to do to add your new jar file to your current Eclipse project build path.

No comments:

Post a Comment