I have made an executable .jar file, stored in a directory of classpath. I think I can execute this .jar file anywhere by just calling java -jar a.jar, since it is in the classpath of my system. However this is not true, I get ZipException: system can't find the file. If I first go to the directory, then run java -jar a.jar, everything is fine. Does that mean I can't depend on the system classpath to load an .jar file? Please help. Thanks in advance. (I am using Java2 1.4).
If you read the note in the Tools Documentation for the -jar switch, it states "When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored." The jar must be in the same directory you issue the command. Plus some other requirements, I suggest you read up on it. You could also check out the tutorialRunning JAR-Packaged Software [ August 28, 2003: Message edited by: Carl Trusiak ]