title: Jar and java.library.path
body: <p>I am trying to use DLL's from a specific place from the disk (because I am using JNotify library).</p>
  
  <p>Using Netbeans 7.4, the following happened:</p>
  
  <p>My temporary program only does:</p>
  
  <p><code>System.out.println(System.getProperty("java.library.path"));</code></p>
  
  <p>As VM options in Netbeans I have set: <code>-Djava.library.path=D:/JNotify-dll/</code>. Program outputs: <code>D:/Jnotify-dll/</code>.</p>
  
  <p>When I run it as normal <code>java &lt;jarfile&gt;</code>: It gives main class not set, while I did set it in Netbeans options.</p>
  
  <p>When I run it as <code>java -jar &lt;jarfile&gt;</code>: It gives me my <code>%PATH%</code> variable.</p>
  
  <p>When I run it as <code>java -jar &lt;jarfile&gt; -Djava.library.path=D:/JNotify-dll/</code> it <strong>still</strong> gives me my <code>%PATH%</code> variable.</p>
  
  <p>Does anyone have any clue what is going on? I am getting real tired of it.</p>
  
  <p>The <code>MANIFEST.MF</code> generated by Netbeans:</p>
  
  <pre><code>Manifest-Version: 1.0
  Ant-Version: Apache Ant 1.9.1
  Created-By: 1.7.0_25-b17 (Oracle Corporation)
  Class-Path: lib/ORM.jar lib/mysql-connector-java-5.1.23-bin.jar lib/co
   mmons-dbcp-1.4-javadoc.jar lib/commons-dbcp-1.4.jar lib/commons-pool-
   1.6-javadoc.jar lib/commons-pool-1.6.jar lib/jnotify-0.94.jar
  X-COMMENT: Main-Class will be added automatically by build
  Main-Class: bf4.bf4logreader.BF4LogReader
  </code></pre>
  
  <p><strong>EDIT:</strong> <code>java -jar -Djava.library.path=D:/JNotify-dll/ &lt;jarfile&gt;</code>, but I'd still appreciate an answer.</p>