Setting CLASSPATH variable for 3rd party jar

M

misra.manisha

I need to set the CLASSPATH environment variable to include a 3rd party
jar that I want with my application. Lets say that the jar is is in the
directory-

C:\ThirdPartyApp\Useme.1.2.3.jar
(I use such a name 'coz my jar has a similar name - multiple ".",
before the actual extension)

When I add this to my CLASSPATH from cmd as
set CLASSPATH=%CLASSPATH%;C:\ThirdPartyApp\Useme.1.2.3.jar;

it appends the jar. But when I try to run my application, say myApp.jar
form cmd, it gives following error-

java.lang.NoClassDefFoundError: com//ThirdPartyApp/abc

Now, this class is definitely present in the Useme.1.2.3.jar....

Where am I going wrong??

Also, if I set the CLASSPATH from cmd, I need to do that every time I
open the cmd window... I want to set the CLASSPATH permanently to
include my jar.... Should I create a variable called CLASSPATH in my
WinXP system's environment variable?

Please help...
 
A

Andrew T.

(e-mail address removed) wrote:
....
...when I try to run my application, say myApp.jar
form cmd, it gives following error-

java.lang.NoClassDefFoundError: com//ThirdPartyApp/abc

Where did that second '/' after com come from?
Why do you have a package called ThirdPartyApp?
Why is your class called 'abc'?

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top