Skip to main content
GameDev.net gamedev.net
🔒 Locked

Eclipse not knowing about included file

Started by Jarwulf Nov 10, 2012 at 1:26 AM 1 replies 1.2k views
Original Post
Jarwulf
Jarwulf
Hi I have a problem trying to include a file in Java and eclipse not seeming to recognize it.

I have

import org.apache.commons.httpclient.HttpClient;

and

HttpClient client = new HttpClient();

when it gets to the second line I get the crash


Exception in thread "Thread-4" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:66)


when I click it tells me that the source attachement does not have HttpClient.class is not found even though I unzipped the jar file referenced and clearly saw it in the directory \org\apache\commons\httpclient. I tried replacing the jar to no avail.

I then took the org folder put it in the src directory of my project workspace and used add library to add it right to the list in the package explorer pane but I reran it and it still cannot seem to recognize that the file it wants is included. What is happening? Thanks
Bruno Sofiato
Bruno Sofiato
It's not the org.apache.commons.httpclient.HttpClient that is missing but the org.apache.commons.logging.LogFactory class (which is part of the Apache's common-logging library).

You must add the common-logging library's jar (and its dependencies, if there's any) to your project's classpath.
incertia
incertia
Just import org.apache.commons.logging.LogFactory and that might fix your problem.
what

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.