title: Not finding libraries for JRI
body: <p>I set up a JRI project for NetBeans 7.4 using 32-bit R 3.0.2 and Java  jdk1.7.0_45, on Windows 7, using the steps outlined <a href="http://www.studytrails.com/blog/r-and-java-jri-using-netbeans/" rel="nofollow noreferrer">here</a>.</p>
  
  <p>When I called</p>
  
  <pre><code>Rengine.versionCheck()
  </code></pre>
  
  <p>I got the following</p>
  
  <p>Cannot find JRI native library!
  Please make sure that the JRI native library is in a directory listed in java.library.path.</p>
  
  <pre><code>java.lang.UnsatisfiedLinkError: C:\Program Files\R\R-3.0.2\library\rJava\jri\jri.dll: Can't find dependent libraries
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
  at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
  at java.lang.Runtime.loadLibrary0(Runtime.java:849)
  at java.lang.System.loadLibrary(System.java:1088)
  at org.rosuda.JRI.Rengine.&lt;clinit&gt;(Rengine.java:19)
  at rjava.RJava.main(RJava.java:40)
  Java Result: 1
  </code></pre>
  
  <p>Following the suggestions <a href="https://stackoverflow.com/questions/19100875/java-r-interface-jri-setup?rq=1">here</a>, I copied all of the dlls from </p>
  
  <pre><code>C:\Program Files\R\R-3.0.2\bin\i386
  </code></pre>
  
  <p>to the directory containing java.exe.  I also right-cliked on the project and selected</p>
  
  <pre><code> Properties:Run:VM Options
  </code></pre>
  
  <p>and added</p>
  
  <pre><code> -Djava.library.path="C:\Program Files\R\R-3.0.2\library\rJava\jri;C:\Program Files\R\R-3.0.2\library\rJava\jri\i386"
  </code></pre>
  
  <p>The problem persisted.  I tried prepending the following to my code.</p>
  
  <pre><code> System.loadLibrary("jri");
  </code></pre>
  
  <p>This resulted in</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Program Files\R\R-3.0.2\library\rJava\jri\jri.dll: Can't find dependent libraries
  at java.lang.ClassLoader$NativeLibrary.load(Native Method)
  at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
  at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
  at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880)
  at java.lang.Runtime.loadLibrary0(Runtime.java:849)
  at java.lang.System.loadLibrary(System.java:1088)
  at rjava.RJava.main(RJava.java:39)
   Java Result: 1
  </code></pre>
  
  <p>I have done everything suggested <a href="https://sdqweb.ipd.kit.edu/wiki/User:Krogmann/R_from_Java" rel="nofollow noreferrer">here</a> but the problem persists.</p>