This content has been marked as final. Show 3 replies
In Windows, when you double click the jar, Windows' File Association uses a form of the command "java -jar ..." to open (run) the jar. When the -jar option is used the only classpath information that Java uses is what is defined by the Class-Path: xxx line in the manifest file.
Apparently your manifest file classpath values are not valid for the new location.
A similar process occures in Solaris, but I don't know the details of that process.
So cant we make a .jar which can run successfully independently from any location?
So cant we make a .jar which can run successfully independently from anyI can! (Using the methods described in great detail here: http://java.sun.com/docs/books/tutorial/deployment/jar/index.html)
Note: images can fail to appear because of how you specify them. So make sure you have read up on the Class methods getResource() and getResourceAsStream() - there are also ClassLoader methods of the same names, but they don't work exactly the same way.
One gotcha with Windows is that jar entries are cAsE sensitive (while Window's file names are not) so images that were found when an application ran from .class files can fail when it (and its resources) are jarred.
Since all sorts of things can go wrong you may need to post some code - including the contents of the manifest file - and the command with which you launch the application. There is no need to go overboard with the code - just enough to illustrate your problem - a simple JFrame showing an image (or not!) only takes a dozen lines or so of code.