I have this simple piece of code that tries to load the JRI module.
public static void main(String... args) {
System.out.println(System.getProperty("java.library.path").toString());
System.setProperty("jri.ignore.ule", "yes");
System.loadLibrary("jri");
}
I am passing the java.library.path as VM arguments but JRI fails to load with the following error:
C:\Users\Abhishek\Documents\R\win-library\3.1\rJava\jri;C:\Users\Abhishek\Documents\R\win-library\3.1\rJava
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\Abhishek\Documents\R\win-library\3.1\rJava\jri\jri.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1847)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1119)
at pack.TestJRI.main(TestJRI.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Thanks in advance for your help.
I know that the post is relatively old and this might not answer the OP's question but will definitely help others who run into a similar situation as like this.
Despite the fact that you're passing the java.library.path
through arguments, you should explicitly set the location of the DLL
files via the PATH
environment variable.
A quick reference to a similar question is provided here but not in context of R
, but a different DLL
altogether.
On the other hand, you could either run this command on your command prompt to check the value of your environment variable PATH
...
java -XshowSettings:properties -version
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With