How do I use simple in eclipse?
Do I add it to the JDK?
http://simple.sourceforge.net
The web site seem to have allot of info on using the methods but little on setting up the library.
I have used C and C++ to set up external libraries before but the Java set up confuses me.
Thank you!
In java world, in order to be able to use third party libraries, what you need to do is to add them to your project/application's CLASSPATH. In case of Simple, its library file is simple-xml-2.4.1.jar that is located inside a folder "jar" within the simple-xml-2.4.1.zip that you would download from Sourceforge.
Download and unzip the
simple-xml-2.4.1 Archive. (ZIP file).
Note that it has a Jar folder that
contains simple-xml-2.4.1.jar - that
is the library eclipse and other IDES
would use to set up the CLASSPATH
Goto your project in project
explorer.
Right-click on the project name and
select "Properties". Alternately, you
can click on the project name and
type "Alt+Enter". A window will
pop-up.
In the window, select "Java Build
Path". You will see several tabs,
including "Source", "Projects" and
"Libraries".
To add simple-xml-2.4.1.jar to your
project, click on the "Libraries"
tab. From there, you can add either
internal jars or external jars. The
"Add External Jar" would be to add a
jar that's on your computer somewhere
. So choose that button, browse to
where simple-xml-2.4.1.jar is located
and make sure to add it to your build
path
Related
I have no experience with package structure. I added two external libraries (from Joda) to my eclipse project. The code makes use of the libraries with no problems. However, when I export the Archived File and open it on another computer, the libraries are no where to be found. Much sadness.The error looks like a little red exclamation point next to my project in the package explorer. Checkboxes next to the libraries have been checked/applied.
Right click on your project
Navigate to build paths -> configure build path
In order and export tab check whether the library is in the list or not
If it is not selected, tick the Checkbox and click apply
Someone told me that I need to export it as a executable jar.
ok guys, I'm trying to import the jfugue android port library into a libdx project, but I don't know how to add the jar files from the core project to the android one, since they don't appear as jar in the add jar option in the android build path project.
The jar file you're pointing to is an external jar (you can see it has a full path), so add to the other project using "Add External JARs" button on the "Libraries" tab of the "Java Build Path" page of the project's properties dialog.
Step-1>Just copy the jar files from Quintas_analizer project and paste
them in libs folder of Quintas_analizer-android. Then right click on
the jar files in Quintas_analizer-android and add to build path.
or
Step-1.1 >Another way is that-> right click Quintas_analizer-android
->properties-> Android->Add-> Select the project Quintas_analizer and add.
If Quintas_analizer not shown then go to Quintas_analizer ->
properties -> Android-> Mark the checkbox ->is a library-> Repeat step
1.1
So I want to have a 'utility project' with all the utility classes and the utility libraries in it (say apache commons libraries under a particular directory called libs in the utility project). So that I can add this 'utility project' to a new project and want to use its java classes and jars both. I know when you add a project you can use its java classes but can't use the jars. Anyway to do this?
You want to create a dependency relation between the two projects. This is better than just adding external JARs as it will keep track of the actual libraries in the utility project even if you change its name or location. To achieve that you need to do two things (although, I believe only step (a) is new to you. If I understand correctly you actually have already carried out (b)).
(a) Go to your utility project then do:
Project -> Properties -> Java Build Path -> Order and Export
Check all the JARs that you'd like to make available to the other project.
(b) Go to the other project (the one that uses the utility project):
Project -> Properties -> Java Build Path -> Projects -> Add
Check the "Utility Project"
You should now see your utility project in the list of projects:
In the properties of the project (from Package Explorer > Right Click > Properties) browse to 'Java Build Path' > Libraries tab.
You can then select the 'Add External JARs' button and add the required jars.
right click on the project where you want to add jars and then select properties. After that select Java Build Path and then click on Add External JARs. You should be able to add jars from here. See following pic, for more info.
Note: You can add reference to projects by clicking on projects tab in same window.
I would suggest you try creating a new "user library" in eclipse which you can use in your projects.
An EclipseSW User Library can be used to represent a set of jarW files. This user library can be added to a project's classpathW. Thus, a user library can be a convenient way to add a set of jar files (rather than individual jar files) to a project's build path. Here, I'll create a user library for a set of TomcatSW jar files.
To create a user library, you can go to Window → Preferences and go to JavaSW → Build Path → User Libraries. I'll click the New button to create a new user library.
More on user libraries at this link
http://www.avajava.com/tutorials/lessons/how-do-i-create-an-eclipse-user-library-for-the-tomcat-jar-files.html
Other ways of doing this at the link below
http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java)
I'm a complete novice to Java, and I'm stuck in trying to use an external jar library in a Java project I'm working on.
The library is Twitter4J (http://twitter4j.org/), a complex group of files which I can't understand how to include. I'm using Eclipse on Windows. I understood the meaning of CLASSPATH enviroment variable (or well, I think I did), but I can't understand how to link it to the Eclipse enviroment.
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 completly 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 property file?
3) How can I include JavaDoc jar files too? Is it possibile to get them into Elipse?
Any kind of help, even just a link, will be very appreciated!
You probably have a project folder for your Eclipse project. Go ahead and make a lib folder inside of your project folder, in the same directory as src and bin. There's nothing special about the lib folder specifically, it's just a convenient name. Copy the .jar file into your newly created folder. Back in Eclipse, right click your project and click Refresh. The lib folder should pop up, including your JAR! Right click the JAR file and go to Build Path --> Add To Build Path. At this point, any class in the project should be able to use Twitter4J features.
As for the What question, the Twitter API property file contains configuration that is necessary for the Twitter jar to function. The file should probably be located on the classpath of your application.
And the How question, you can attach the javadoc jar file of the Twitter jar to the Twitter jar's classpath entry in Eclipse. Right-click your project and select Properties. Go to the Java Build Path entry and find the Twitter jar under the Libraries tab. If you expand the Twitter jar entry you will see 'JavaDoc location'. You can specify the javadoc jar there.
In Eclipse, right-click your project, select Properties. Now find the entry for Java Build Path and select it. Click the "Libraries" tab if it is not already selected. Click the "Add external JARs..." button. Follow the prompts.
I have downloaded common.codec binary jar file. Now I want to use the class org.apache.commons.codec.binary.Base64. But this folder contains four jar files namely common.codec-1.7.jar,commons-codec-1.7-javadoc.jar, commons-codec-1.7-sources,commons-codec-1.7-tests,commons-codec-1a.7-test-sources. Now which path should I mention in class path? And I tried with all the jar file paths and imported in my program but failed. Please tell me where to place this downloaded jar file and how to use it in my code.
You can use common.codec-1.7.jar if you are using an IDE like
Eclipse:
1.Right-click your Project.
2.Select Properties.
3.On the left-hand side click java build path.
4.Under Compile tab - click Add External Jars button.
Netbeans :
1.Right-click your Project.
2.Select Properties.
3.On the left-hand side click Libraries.
4.Under Compile tab - click Add Jar/Folder button.
or if you directly compiling classes without IDE you can do as #S.R.I mentioned in comment.