i am try to use a jar in the classpath on the command line and it doesn't work. I have tried : java -classpath testlib.jar -jar test.jar where testlib.jar is a library jar needed to execute test.jar and test.jar is a jar with a Main class described in its manifest. Of course, both testlib.jar and test.jar are in the current directory.
On the other hand, putting testlib.jar in the ext/ directory inside the jre and typing "java -jar test.jar" works well.
I really don't see why this doesn't work. If any of you have a clue, let me know.
The "-jar" switch is used to run executable JAR files. An executable JAR file contains a manifest file in which the main class and the classpath is specified. With the "-jar" switch, the -cp and -classpath options are ignored, and the classpath specified in the manifest file is used instead.