hello all,
I have a jar file named result.jar and it
has a manifest file which has the following entry:
Main-Class: package.className
Class-Path: dependent1.jar dependent2.jar dependent3.jar
As long as all the jar files are in the current directory, the executable jar works fine.
java -jar result.jar
Say all these jars are in the directory
d:\DIRECTORY_1
Now if i move over to say
c:\
and then do
java -jar d:\DIRECTORY_1\result.jar
it works fine.
This is bcos it picked up the dependent jars from d:\DIRECTORY_1.
1. Now I tried moving result.jar (only) to c:\
2. Set the classpath to point to the dependent jars residing in
d:\DIRECTORY_1 folder,
did a
c:\ java -jar result.jar
i got class not found exceptions from result.jar!
It was expecting to find the dependent jars in c:\!
the classpath setting was ignored.
This has left me pretty confused.
Any inputs??
Can i conclude that the classpath does'nt work in case of jars referring to other jars from within?? :-(.
All the depenedent jars have to be in the same folder as the first guy? PLease correct me.
thanks,
karthik.
thanks
karthik.