• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

java not finding the class in a jar

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
amit81sharma
Asked:
amit81sharma
1 Solution
 
CEHJCommented:
The methodology recommended is to put it in the lib directory of your webapp
0
 
StillUnAwareCommented:
the CLASSPATH must include the jar itself like:

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

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now