1

I want to connect Java to R using JRI. I installed rJava in R consul and I set the R_Path:

R_Path=C:\Users\fmar825\Documents\R\win-library\3.1\rJava\jri
PATH=JLP = C:\Program Files\Java\jdk1.8.0_20\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;

and I run my project but still I get the following Error.

run:

JLP = C:\Program Files\Java\jdk1.8.0_20\bin;C:\Windows\Sun\Java\bin;C:
\Windows\system32;C:\Windows;.
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: C:\Program Files\Java\jdk1.8.0_20\bin\jri.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
    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 org.rosuda.JRI.Rengine.<clinit>(Rengine.java:19)
    at rtest.main(rtest.java:63)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
ApproachingDarknessFish
  • 14,133
  • 7
  • 40
  • 79
user46759
  • 103
  • 9
  • I have found the solution finally. one the possible way of connecting java to R is using Rserve. then with the Rserve. Then you have to add two jar files to the library, 1-REngine.jar and 2-RserveEngine.jar.More over you have to make sure that you copy R.dll inside the Rserve/lib/64x for windows user. – user46759 Oct 24 '14 at 03:08
  • JRI might be a better alternative,since you can run it on stand alone mode. regarding your issue, i think you didnt set Java_home, and in java you didnt add to your project the required Jar files, also you need to add vm options on your IDE. if your interested i can help you set up JRI – Yehoshaphat Schellekens Nov 05 '14 at 06:18
  • Thank you very much i am interested to set up JRI, if you can help me. I have one more question, what do you mean by stand alone mode. – user46759 Nov 06 '14 at 02:44
  • Stand alone mode means that its a software that runs on local PC and doe's not require other external computers, although i don't have a lot of experience in Rserve, it seems like you need some external server to use it, while when you use Rengine, you can build a java software that runs on a local machine (iv'e don that, works great) – Yehoshaphat Schellekens Nov 06 '14 at 06:21
  • 1
    This might help- [https://stackoverflow.com/questions/19100875/java-r-interface-jri-setup](https://stackoverflow.com/questions/19100875/java-r-interface-jri-setup) – Satyam Kumar Feb 11 '19 at 07:19

0 Answers0