title: Alternatives to setting java.library.path?
body: <p>I have a Java program making some JNI calls to a native library ("mylib.so"). Whenever I want to run this program, from the command line, I must set java.library.path to the location of my library as such:</p>
  
  <pre><code>java -Djava.library.path=/var/natives/ -classpath MyPackage.jar MyPackage.MyClass arg1 arg2
  </code></pre>
  
  <p>I'm wondering if there are any alternatives so I do not have to set it with the -D option everytime I run my program.</p>
  
  <p>I have tried adding <code>/var/natives/</code> to my $PATH variable, but it still complains that it cannot find the library if I do not explicitly set it with -D. </p>
  
  <p>Do I have any other options?</p>