I am trying to tune the path to JAR classes so that my ResourceBundle can extract property files from it.
If I run it from .class files and set the -cp flag, it works fine, and System.err.println(System.getProperty("java.class.path")); will print the path specified in -cp .
If I try to create a jar file for it, System.err.println(System.getProperty("java.class.path")); always prints the path to the jar file, and property files are not matched.
It seems that if you use it as a jar file, you cannot specify the -cp flag (this was what I hoped for, as it is often used to switch which property files are used). I tried specifying it in the jar manifest instead, but it still doesn't work.
Here is the code and manifest from the test jar, which doesn't seem to work:
public final class Test { public static void main(final String[] args) { System.err.println(System.getProperty("java.class.path")); } }
Manifest-Version: 1.0 Created-By: 1.6.0_20 (Sun Microsystems Inc.) Main-Class: Test Class-Path: /home/ajanuary/Projects/test/
change The original path was pretty pointless, so I changed it. I want to point to the directory that the ResourceBundle can find in the properties file.
source share