Search code examples
javajri

R.dll causing Error


I am trying to execute R code using rJava but on setting R.dll path in the environment variables causing the program to crash. The program crashes on executing any R function. I also tried to run jri example but no help.

enter image description here

Any solution or hint would be very helpful


Solution

  • (If your using net beans) You should show the JVM the path (JRI.dll) in the following way:

    enter image description here

    To be more specific you need to point the following :

    -Djava.library.path='C:/Users/yschellekens.INTRANET/Documents/R/win-library/3.0/rJava/jri/x64/'
    

    to where the JRI.dll is located, although this might not be your problem, since when i'm removing the path in Netbeans, i get the following error (which is different from yours):

    run:
    Cannot find JRI native library!
    Please make sure that the JRI native library is in a directory listed in java.library.path.
    
    java.lang.UnsatisfiedLinkError: no jri in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
        at java.lang.Runtime.loadLibrary0(Runtime.java:845)
        at java.lang.System.loadLibrary(System.java:1084)
        at org.rosuda.JRI.Rengine.<clinit>(Rengine.java:19)
        at stackoverflow.StackOverflow.main(StackOverflow.java:21)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)
    

    hope that helps.