title: Can I find out what variable java.library.path maps to on the current platform?
body: <p>So far I've learned the following about the java.library.path property:</p>
  
  <ul>
  <li>It's used when loading native libraries, as opposed to java classes</li>
  <li>Its default value depends on the operating system:
  <ul>
  <li>On Windows, it maps to PATH</li>
  <li>On Linux, it maps to LD_LIBRARY_PATH</li>
  <li>On OS X, it maps to DYLD_LIBRARY_PATH</li>
  </ul></li>
  </ul>
  
  <p>(Please correct me if I've misunderstood any of the above)</p>
  
  <p>My motivation:</p>
  
  <p>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.</p>
  
  <p>My question:</p>
  
  <p>Is there a way to ask the local Java implementation what environment variable java.library.path maps to?</p>
  
  <p>Then, in a shell script, I'd be able to write something along the lines of:</p>
  
  <pre><code>path_var = get_library_path_variable  # the magic function I want to call
  ${path_var} = /my/custom/path:${${path_var}}
  </code></pre>