Accepted answer

you can add a jar in eclipse by right-clicking on the project → build path → configure build path. under libraries tab, click add jars or add external jars and give the jar. a quick demo here.

enter image description here

the above solution is obviously a "quick" one. however, if you are working on a project where you need to commit files to the source control repository, i would recommend adding jar files to a dedicated library folder within your source control repository and referencing few or all of them as mentioned above.


first of all you will go to your project what you are created and next right click in your mouse and select properties in the bottom and select build in path in the left corner and add external jar file add click apply .that's it


in eclipse i included a compressed jar file i.e. zip file. eclipse allowed me to add this zip file as an external jar but when i tried to access the classes in the jar they weren't showing up.

after a lot of trial and error i found that using a zip format doesn't work. when i added a jar file then it worked for me.


  1. right click on the project.
  2. click on build path.
  3. click on configure build path.
  4. under libraries, click on add jar or add external jar.


jar file in the system path is:


ojdbc14.jar(it's jar file)

to import jar file in your eclipse ide, follow the steps given below.

  1. right-click on your project
  2. select build path
  3. click on configure build path
  4. click on libraries, select modulepath and select add external jars
  5. select the jar file from the required folder
  6. click and apply and ok


eclipse -> preferences -> java -> build path -> user libraries -> new(name it) -> add external jars

(i recommend dragging your new libraries into the eclipse folder before any of these steps to keep everything together, that way if you reinstall eclipse or your os you won't have to rwlink anything except the jdk) now select the jar files you want. click ok.

right click on your project and choose build path -> add library

fyi just code and then right click and source->organize imports


just a comment on importing jars into eclipse (plug-in development) projects:

in case you are developing eclipse plug-ins, it makes sense to use eclipse's native bundling mechanism instead of just importing the jar into a plug-in project. eclipse (or better its underlying osgi runtime, equinox) uses so-called bundles which contain some more information than plain jars (e.g., version infos, dependencies to other bundles, exported packages; see the file). because of this information, osgi bundles can be dynamically loaded/unloaded and there is automatic dependency resolution available in an osgi/eclipse runtime. hence, using osgi bundles instead of plain jars (contained inside another osgi bundle) has some advantages.

(btw: eclipse plug-ins are the same thing as osgi bundles.)

there is a good chance that somebody already bundled a certain (3rd party) library as an osgi bundle. you might want to take a look at the following bundle repositories:


here are the steps:

  1. click file > import. the import window opens.

  2. under select an import source, click j2ee > app client jar file.

  3. click next.

  4. in the application client file field, enter the location and name of the application client jar file that you want to import. you can click the browse button to select the jar file from the file system.

  5. in the application client project field, type a new project name or select an application client project from the drop-down list. if you type a new name in this field, the application client project will be created based on the version of the application client jar file, and it will use the default location.

  6. in the target runtime drop-down list, select the application server that you want to target for your development. this selection affects the run time settings by modifying the class path entries for the project.

  7. if you want to add the new module to an enterprise application project, select the add project to an ear check box and then select an existing enterprise application project from the list or create a new one by clicking new.

    note: if you type a new enterprise application project name, the enterprise application project will be created in the default location with the lowest compatible j2ee version based on the version of the project being created. if you want to specify a different version or a different location for the enterprise application, you must use the new enterprise application project wizard.

  8. click finish to import the application client jar file.


two choices:

1/ from the project:

alt text

2/ if you have already other jar imported, from the directory "references libraries":

alt text

both will lead you to this screen where you can mange your libraries:

alt text


adding external jar is not smart in case you want to change the project location in filesystem.

the best way is to add the jar to build path so your project will compile if exported:

  1. create a folder called lib in your project folder.

  2. copy to this folder all the jar files you need.

  3. refresh your project in eclipse.

  4. select all the jar files, then right click on one of them and select build path -> add to build path

Related Query

More Query from same tag