Eclipse "cannot be resolved to a type" and new .JAR lib - config prob?

I'm trying to make use of the Commons HttpClient library in a project being built in Eclipse (3.1). I have a sample program (PostXML) that runs into "cannot be resolved to a type" on the "HttpClient" object. I think the problem is that the JRE 1.4.2 (Mac OS-X) system library includes an earlier release (3.0.1) of the HttpClient, but some of the classes used by PostXML are in the 3.1rc of HttpClient. I've downloaded the newer release, created a user library, and modified the load order so I can see the user library above (i.e. loaded prior to?) the System JRE in the package browser. I can see the HttpClient.class in the Package browser. I have "import org.apache.commons.httpclient.methods.*;" in the head of the application (that took tweaking). Several of the HttpClient methods resolve correctly, but not the HttpClient object constructor itself. I am also finding I cannot simply import all the HttpClient methods, but must import each explicitly (?). Suggestions?

[984 byte] By [brj2006a] at [2007-11-27 2:30:24]
# 1

I have gotten the sample code to compile and run, though I still have some confusion about needing the explicit imports (as compared to a wildcard import). In the end I believe my "cannot be resolved to a type" error was due to dependencies within the HttpClient library on the commons-codec library. Once I downloaded and installed that, the samples started working better. Still trying to understand the API, but making progress.

brj2006a at 2007-7-12 2:44:07 > top of Java-index,Java Essentials,New To Java...
# 2

> I have gotten the sample code to compile and run,

> though I still have some confusion about needing the

> explicit imports (as compared to a wildcard import).

> In the end I believe my "cannot be resolved to a

> type" error was due to dependencies within the

> HttpClient library on the commons-codec library. Once

> I downloaded and installed that, the samples started

> working better. Still trying to understand the API,

> but making progress.

when downloading third-party libraries, check the download page to see if it has any further dependencies. apache libraries are notoriously dependent on other apache libraries

regarding the imports, it's not that there's a need for explicit imports, it's more that wildcard imports are a bad idea. explicit imports gives other people looking at your code a first clue as to what it does, and it also can serve as an indicator that your class is too big, if there are lots of imports. wildcards hide this from you. apart from that, it makes no difference to your code, and imports don't even exist at runtime so it affects how your code actually runs, not at all

georgemca at 2007-7-12 2:44:08 > top of Java-index,Java Essentials,New To Java...