Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse IDE- Add jar? Add External jar? Add Library?

I want to integrate TwitterAPIME to my Blackberry project. I have 3 Jar files provided by TwitterAPIME. I am not sure how to link these 3 Jar files to my project.

My basic doubts are

What is an External Jar ? What is a Library ?

What's the difference between Adding jar, Adding External jar or Adding Library ?

like image 687
Chethan Thimmappa Avatar asked Dec 13 '11 08:12

Chethan Thimmappa


People also ask

How do I create a JAR file with an external library?

You can right-click on the project, click on export, type 'jar', choose 'Runnable JAR File Export'. There you have the option 'Extract required libraries into generated JAR'.

Why can't I add external JARs in Eclipse?

However, the 'add external jars' button is greyed out, implying that i am not allowed to use it. Can anyone help? If your project builds with Java 9+ make sure you've selected Classpath (as shown here). You should also be able to add the JAR with right-click on the project > Build Path > Add External Archives....


1 Answers

What is an External JAR?

  • External as the name suggest is a Jar file that is not built by the currently developing code. It is a utility Jar file that is added externally for extra features. It could be an API Jar file provided from the external site, just as in your case the 3 Jar files will be going to call External Jar Files.
  • To add an External Jar file in Eclipse, follow these steps: Right Click on Project -> Select Build Path -> Select Configure Build Path -> Library Tab in the following Dialog box.

What is a Library?

A Library is a in-built Jar file from the JDK Directory or any other software e.g. J2ME-Polish as you can see in the Image above. Normally these Library files are developed by a manufacturer.

What's the difference between adding JAR, Adding External JAR, and Adding Library?

  • Adding Jar File: When you have more than one project in Eclipse and you add another project's Jar file, that is called adding Jar File. There is a first Button in the Photo above, it only allows you to add Jar file from the other Project.
  • Adding External Jar: When you add any API Jar file provided by the site or another manufacturer. In your case the 3 Jar files are External Jar Files. You can add then by using second Button "Add External JARs".
  • Adding A Library: Clicking on the 4th Button will open a dialog box as below.

    You can add different libraries installed on your system. You can also add your own Library, by selecting "User Library".

like image 118
Lucifer Avatar answered Sep 18 '22 12:09

Lucifer