How to use * .jar file in Java project?

I'm a complete newbie to Java, and I'm stuck trying to use the external jar library in the Java project I'm working on.

The library is Twitter4J ( http://twitter4j.org/ ), a complex group of files that I cannot figure out how to include. I am using Eclipse on Windows. I understood the meaning of the CLASSPATH environment variable (or, I think I did), but I cannot figure out how to associate it with the Eclipse environment.

This blog post seemed to be what I was looking for: http://jasperpeilee.wordpress.com/2012/01/25/how-to-set-up-twitter4j-quickly-in-your-java-project/

But:

Add twitter4j-core-2.2.5.jar into project for general use. 

1) Where should I copy the core file? In the /bin/ ? Folder Or in a completely unrelated /lib/ folder, as this question in SO stated?

 Copy Twitter API property file into your project/bin directory. 

2) What is the Twitter API properties file?

3) How to enable JavaDoc boxes? Is it possible to get them at Elipse?

Any help, even just a link, would be greatly appreciated!

+7
source share
3 answers

You probably have a project folder for your Eclipse project. Go ahead and create the lib folder inside the project folder, in the same directory as src and bin . There is nothing special in the lib folder, it is just a convenient name. Copy the .jar file to the newly created folder. Return to Eclipse, right-click your project and click Refresh . The lib folder will appear, including the JAR! Right-click the JAR file and select Build Path โ†’ Add To Build. At this point, any class in the project should be able to use Twitter4J features.

+9
source

Regarding Question What , the Twitter API properties file contains the configuration necessary for the Twitter banner to work. The file should probably be in the class path of your application.

And the question is How can you attach the javadoc jar twitter banner file to the jar class element of classpath in Eclipse. Right-click the project and select Properties. Go to the Java Build Path entry and find the Twitter jar on the Libraries tab. If you look at the Twitter bank entry, you will see a โ€œJavaDoc locationโ€. Here you can specify javadoc jar.

+2
source

In Eclipse, right-click the project and select Properties. Now find the entry for the Java Build Path and select it. Click the Libraries tab if it is not already selected. Click the "Add External JAR ..." button. Follow the instructions.

0
source

All Articles