views:

55

answers:

1

I want to download the httpConnection class from apache but I cant find a link, also need to know how to import it and where to put the class files when i have them.

+5  A: 

You mean the org.apache.http.HttpConnection interface? That's part of the HttpComponents Core library. You can just download it from here. Extract the zip and just put the JAR file containing the classes in the classpath.


Update: as per your comment, I see that you're totally new to Java. I would strongly recommend to leave the HttpConnection bit for what it is and start to familiarize yourself with the basic Java concepts. This is a good place to get started. The classpath part is explained in this chapter and in more technical detail in this article.

Note that there are basically two ways to define the classpath, one using the %CLASSPATH% environment variable and other using the -classpath or -cp argument of javac.exe and java.exe. You can use only the one or the other, not both. I'd suggest to just use the -cp argument.

BalusC
where exactly is the class path?
Masterban
That's just an abstract term to indicate the location from where the JVM has to load classes from. Usually, this is to be specified using the `-classpath` or `-cp` argument of `javac.exe` and `java.exe`.
BalusC
i edited the class path and put the jar in the path and yet when i try import on netbeans it doesnt work.
Masterban
OK, you're new to Netbeans as well. In an IDE like Netbeans the classpath is called *Build Path*. You need to add the JAR file to the build path in the project's properties.
BalusC
thanks a lot, got it working
Masterban