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 :, and when I try running test program for JRI, I get this following error :

« cannot find JRI native library »

You need to copy the “” 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 « » located then copy to java.library.path :

  • $ locate
  • /usr/local/lib/R/site-library/rJava/jri/
  • $sudo cp /usr/local/lib/R/site-library/rJava/jri/ /usr/lib

Another error coming:

cannot find system Renviron

For this error, this solution works…

View original post 70 mots de plus

Par défaut