So far I've learned the following about the java.library.path property:
- It's used when loading native libraries, as opposed to java classes
- Its default value depends on the operating system:
- On Windows, it maps to PATH
- On Linux, it maps to LD_LIBRARY_PATH
- On OS X, it maps to DYLD_LIBRARY_PATH
(Please correct me if I've misunderstood any of the above)
My motivation:
I want to modify the value of java.library.path seen by a Java application from the framework I've set up to invoke the Java application. I want to do this not by setting the java.library.path property directly, but instead by modifying the system path variable that it maps to. I'd like a clean way to do this that doesn't have ugly OS-specific code or leave out edge cases if possible.
My question:
Is there a way to ask the local Java implementation what environment variable java.library.path maps to?
Then, in a shell script, I'd be able to write something along the lines of:
path_var = get_library_path_variable # the magic function I want to call
${path_var} = /my/custom/path:${${path_var}}