Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Eclipse not knowing about included file


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Jarwulf   Members   -  Reputation: 173

Like
0Likes
Like

Posted 09 November 2012 - 07:26 PM

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

#2 Bubsy   Members   -  Reputation: 333

Like
1Likes
Like

Posted 09 November 2012 - 07:37 PM

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.

#3 incertia   Crossbones+   -  Reputation: 521

Like
0Likes
Like

Posted 11 November 2012 - 01:30 PM

Just import org.apache.commons.logging.LogFactory and that might fix your problem.
Current project here




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS