This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I've created an executable jar with the MANIFEST.MF as follows.
It executes fine. HOWEVER, I cannot get classpath to work.. I keep getting ClassNotFoundException from accessing any external classes. My command line is java -jar -cp jconn2.jar myparser.jar Thanks for any help in advance. I have tried the normal method of executing the class, and it works. [ September 06, 2002: Message edited by: Chu Tan ]
Joined: Apr 19, 2002
It works if I put Class-Path option in the manifest, that means I must put a copy of the dependant jar in the same directory. I'd rather not do that, if there are any alternatives.
From Understanding the Manifest: The URLs in the Class-Path header are given relative to the URL of the JAR file of the applet or application. I can't think of a way around that, but I can imagine a situation where it may be convenient to specify an absolute URI. (I do realize that didn't really help solve your problem.) Good Luck.
It works if I put Class-Path option in the manifest, that means I must put a copy of the dependant jar in the same directory. I'd rather not do that, if there are any alternatives. Just to be thorough... You don't have to put each jar in the same directory, but they do have to be in a relative directory structure. So, One.jar could be in the root directory and Other.jar could be in a subdirectory called anything. The Class-Path setting would then be specified as Class-Path: One.jar anything/Other.jar