RJava error when working with Eclipse

I installed R 3.0.1 and Eclipse Kepler. (I installed StatE to run R-script through and Eclipse R-console without problems.) However, I cannot get the Java program to run. I am posting my questions to find out if anyone else has met them or can help me understand what I'm doing wrong. After installing R, rJava (via R) and the eclipse, I launched the RJavaEclipse plugin from studytrials.com. Then I configured the paths to the corresponding libraries or .dll.

enter image description here

When I try to run the rtest.java file that comes with the rJava JRI, I get the following error:

Unable to find native JRI library! Verify that the source JRI is in the directory specified in java.library.path.

java.lang.UnsatisfiedLinkError: no jri in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at org.rosuda.JRI.Rengine.<clinit>(Rengine.java:19) at rtest.main(rtest.java:61) 

When I try to run through the run tab in eclipse -> run configurations -> R -> rtest, a pop-up warning appears that says:

 R_HOME must be set or R properly installed (\Software\R-core\InstallPath registry entry must exist). 

So, following the tips that give so much on SO, I tried to find the answer in the warning message.

I found that the path information in Eclipse (and Windows) pointed to the right places in both the library and the R run configuration: enter image description hereenter image description here (C: \ Users \ csnyder \ Documents \ R \ win-library \ 3.0 \ rJava \ jri \ x64; C: \ Program Files \ Java \ jre7 \ bin \ server; C: \ Program Files \ R \ R-3.0. 1 \ Bin \ x64)

These paths also correspond to environmental window paths.

enter image description here

So, I am at a loss. If anyone has any suggestions regarding my problem, I would really appreciate it. Please comment if you need more information.

+4
source share
2 answers

I had the same problem on Linux. Essentially, this setting does not update java.library.path properly, and communication with JRI banks is not performed. I started by printing the path to the console with:

System.out.println(System.getProperty("java.library.path"));

And got the following:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

To ensure that the Eclipse java.library.path correctly updated at run time, the Native library location element must be installed in the folder containing the JRI banks ( /usr/local/lib/R/site-library/rJava/jri in my case):

enter image description here

Just select an item and click "Change ..." to change its value.

+2
source

you can try adding jri.dll (to your rJava / jri / x64 package) in the path of the System environment variable, for example: (sorry, I can’t put the image on it) in this way, restart the IDE and just run the test.

0
source

Source: https://habr.com/ru/post/1499653/


All Articles