Getting JRI works for R and Java

Ungeek Traveler

First, I would like to thanks to Fei for the very useful tutorial,

I try several times to setup the environment, and try some configuration to get JRI works with Java. then I faced exactly the same problem.

I already have these following environment to run the program

  • OS : Ubuntu 12.04.2
  • Java : JDK 1.7.0_21
  • R : 3.1.0

I downloaded the JRI from this site : http://rforge.net/JRI/files/, and when I try running test program for JRI, I get this following error :

« cannot find JRI native library »

You need to copy the “libjri.so” to “java.library.path”. Use following to show the path:

in your java program :

  • System.out.println(System.getProperty(“java.library.path”));

Since I already jave rjava installed, first i find where my « libjri.so » located then copy to java.library.path :

  • $ locate libR.so
  • /usr/local/lib/R/site-library/rJava/jri/libjri.so
  • $sudo cp /usr/local/lib/R/site-library/rJava/jri/libjri.so /usr/lib

Another error coming:

cannot find system Renviron

For this error, this solution works…

View original post 70 mots de plus

Publicités
Par défaut