I've recently put an executable jar file together which is dependant on several other jar files. When I create the executable jar file I ammend the classpath in the manifest to include those libraries,
i.e. Class-Path: ./lib/jasperreports-1.2.3.jar ./lib/log4j-1.2.13.jar
these references are obviously relative to the location of the executable jar file. If I then run the executable jar file from its own directory everything works fine. However, if I run it from another directory the classpath obviously points to the wrong location, and nothing works.
How do I set the classpath so that it's relative to the executable jar file no matter where I run it from?
The reason I want to know is that I'm planning to execute the jar from a cgi file, however the cgi file could be located anywhere.