Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

java not finding the class in a jar

Posted on 2006-07-24
2
269 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
map related example 6 55
even odd program using while loop 3 60
MySQL  on Tomcat 8 68
ejb mdb examples 1 6
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

807 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