First you can download the the tar file from http://www.rforge.net/rJava/files/. I used the rJava_0.8-5.tar.gz. Then I unzip the file to my desktop. You can find two sample files under ~/Desktop/rJava/jri/examples. Currently, I just need jri.
When you run the test file in Eclipse, you might get error:
- Cannot find JRI native library
You need to copy the “libjri.so” to “java.library.path”. Use following to show the path:
Use this command:
- sudo cp ~/Desktop/rJava/jri/libjri.so /usr/lib
Another error coming: “cannot find system Renviron”.
For this error, you have several solutions:
- set up “environment” in Eclipse per file under “Run Configuration…” (works, not productive)
- set up system environment variables (works for whole Eclipse)
- create a script to pass the information (not pass my test yet)
- Script: http://sonivis.org/startupEclipse