Solved

java not finding the class in a jar

Posted on 2006-07-24
2
257 Views
Last Modified: 2013-11-24
Hi,
  I am trying to run  a java class  which is using commons-httpclient-2.0.2.jar  which is in /var/tomcat/shared/lib, my CLASSPATH variable is pointing to /var/tomcat/shared/lib but when i try to run it it gives me error :
  Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpMethod.

Please Help,
Thanks,
-A
0
Comment
Question by:amit81sharma
2 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 17169650
The methodology recommended is to put it in the lib directory of your webapp
0
 
LVL 14

Accepted Solution

by:
StillUnAware earned 250 total points
ID: 17169658
the CLASSPATH must include the jar itself like:

/var/tomcat/shared/lib/commons-httpclient-2.0.2.jar
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now