How to install org.apache.commons.httpclient in Eclipse? - eclipse

I need to install this library: org.apache.commons.httpclient.
Iwe tried unsing Help -> Install new software but I cant find it there
Please help me I` would need to use in my program these:
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.MultipartPostMethod;

You don't need to install it. Search for the jar containing it and then in eclipse right click on your project -> build path. In the new window, go to libraries, add a new user library and in that new one, add your jars.

Download "commons-httpclient-3.0.1.jar" adn save to your local hard disk.
Go to you project, right click/properties/java build path/library/Add External library.
Provide the path to the jar saved on your hard disk and press ok. You can use the classes(HttpClient,MultipartPostMethod) available in the jar.
Thank you

Related

Eclipse Kura OSGi Dependency Management

Preface: I'm new to Eclipse, OSGi, and Kura
I'm trying to develop a Kura plug-in that depends on org.apache.httpcomponents.httpclient. I found an OSGi bundle for the package here.
Currently, the only way I'm able to use the plug-in (with the OSX Kura emulator) is to download httpclient-osgi-4.5.jar and add it to ~/Documents/workspace/target-definition/common/repository/plugins/. Otherwise I get a class not found error.
When I add the plugin to MANIFEST.MF either as with REQUIRE-PLUGIN or IMPORT-PACKAGE, Eclipse cannot find the package.
What's the correct way to require, fetch, and add to the classpath a remote dependency using Eclipse Kura/OSGi? Eclipse currently only looks in my local workspace for dependancies, is there an accepted way to fetch remote plugins?
Thanks for the help!
The bundles located in target-definition/common/repository/plugins are part of an M2 repository created by the Kura build. It is not enough to simply copy your required bundle to that directory. The solution I typically use to accomplish what you want is:
Double click the kura-equinox_3.8.1.target file located in target-definition. This should open in the Eclipse IDE.
Under "Locations", click "Add...". Then select "Directory" and "Next". Select the folder containing your required additional bundles and click "Finish".
Save the kura-equinox_3.8.1.target file and click "Set as Target Platform". Your new bundle should now be available in Eclipse.
Thanks,
--Dave
What for me works is;
Simply copied the bundle in ${workspace_loc}/target-definition/common/repository/plugins
Clicked on reload
Clicked on Set as Target Platform
After these steps, Eclipse is aware of my bundle and could able to use it anywhere.

Did not find "JAVADB_DRIVER_LABEL" in NetBeans IDE 8.0.2

I have installed NetBeans IDE 8.0.2.
When I am importing .zip file of my old project on which I was working, it's showing
"JAVADB_DRIVER_LABEL" could not be found (in projectNAME)
When I was adding that driver library it was not there in NetBeans' Library list. So what should I do to run my project ?
This is an old question, but for anyone searching in the future, here is my experience. When I shared a project with a customer which used Derby database, they needed to load the Java DB Driver, which in my case includes the derby.jar, derbyclient.jar, and derbynet.jar files. Until those where added, they got the JAVADB_DRIVER_LABEL error. In Netbeans, to do this you can either locate the *.jar files I referenced and add them in your Libraries folder in the project as jars, or use the "add library" option (right click on Libraries, Add Library) and select the "Java DB Driver" library which will add the necessary files.
I got that. We just Have to make New class Library and give it name "JAVADB_DRIVER_LABEL" and simply press OK button !
I have solved the problem:
You need to right click library and click add library
Create library
Put name whatever you want
Add jar for class path
Choose -derby.jar -derbyclient.jar -derbynet.jar
OK
Go to the beginning and add the library which is created by you

Attempting to install library into netbeans (Xstream)

I am currently using the NetBeans IDE 7.3 for my Java development.
I downloaded a file called XStream.
http://x-stream.github.io/
I attempted to add the library to my project by right clicking on libraries and choosing Add Library. I then selected the top level folder for the downloaded Xstream; I was unable to import any of the Xstream files into my project. I am sure I am missing a simple step but Googling "Installing XStream in netbeans" does not reveal any how-tos.
I also right clicked Libraries and chose Add Jar/Folder and I still cannot import XStream.
Can someone please point me in the direction of a simple explanation for installing XStream in Netbeans so I can use it in a java project?
I tried the same thing as you, #Aaron and got the same result. However, when I drilled down and selected the xstream-1.4.8.jar instead of just the top level folder, I had success. I realize this is a couple years late, I'm just hoping this'll be useful for future readers.
In order to easily add libraries in Netbeans you must -
Locate your project in the project viewer window. Then click to drop down the project information.
Locate the "Libraries Folder"
Right click on the "Libraries Folder"
You may add a library there or a jar using that list
After you add the library you may want to make sure that the jar is in an easy to find location. I normally create a folder in my project and store the JAR file or libraries there in order to simplify locating them.

How to build a downloaded a java source code in net-beans 6.9?

I have downloaded source code from http://e-adventure.svn.sourceforge.net/viewvc/e-adventure/ .
How do I build it and run it in netbeans ?
There is a Compilation.txt file in the source code. You should read that and follow the directions. It says that it is an Eclipse project. Once you have followed the directions (notably downloading a jar file archive), you can try the:
File -> Import Project -> Eclipse Project
menu option and try and import it. Then, perhaps, it will build for you. I have not done this with an Eclipse project, so I don't know how well it works. It may well need some tweaking to get right.

Installing a library (WiiRemoteJ) into NetBeans

I downloaded the WiiRemoteJ java library from here:
http://dl.qj.net/wii/homebrew/wiiremotej-v14.html
But I don't know how to install it into netbeans to use with a project!
I went to tools>Libraries, then clicked New Library... then typed "wiiremotej" as the name. Under class path, I navigated to the "WiiRemoteJ.jar" file. Then I added the JavaDocs folder.
When I created a new project and tried to import the library, (import WiiRemoteJ.*;) it gives me an error and says "Package WiiRemoteJ does not exist"!
The same thing happened with another wii remote library I tried (motej)
Does anyone know what i am doing wrong?
Well, the most straight forward approach would be to right click the project's Libraries node, and select Add JAR/Folder. This way you can use the JAR right away, without any additional registration.