[R] Cannot load RInterpreter (SJava)

Martin Morgan mtmorgan at fhcrc.org
Tue Jan 19 15:58:45 CET 2010


Jiiindo wrote:
> Hello,
> I write a test for call R function from Java by Eclipse. When i run it,
> raise a error:
> 
> Loading RInterpreter library
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no RInterpreter
> in java.library.path
> 	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
> 	at java.lang.Runtime.loadLibrary0(Runtime.java:823)
> 	at java.lang.System.loadLibrary(System.java:1028)
> 	at
> org.omegahat.R.Java.ROmegahatInterpreter.<clinit>(ROmegahatInterpreter.java:34)
> 	at RTest.JavaR2.main(JavaR2.java:10) 
> ok, i have set variable PATH => directory contain file .so (i use UBUNTU)
> correct..and i install R with option --enable-R-shlib.
> When i create script for call this class file, it run....result:
> 
>          Loading RInterpreter library
>          R version 2.10.1 (2009-12-14)
>         -----
> In this script, I use command  java -     
> Djava.library.path=${SJAVA_PATH}:/usr/local/R/lib/R/library/SJava/libs -cp 
> $CLASSPATH:${SJAVA_PATH}/rsjava.jar:${SJAVA_PATH}/antlr.jar:${SJAVA_PATH}/Environment.jar:${SJAVA_PATH}/jas.jar:${SJAVA_PATH}/jhall.jar
> $*
> 
>  i set variable PATH =
> $PATH:/usr/local/R/lib/R/library/SJava/libs:/usr/local/R/lib/R/library/SJava/org/omegahat/Jars?
> CLASSPATH=....
> correctly. 
> 
> Why i have error when i use Eclipe to run it? (It not load  RInterpreter
> library)

In the eclipse Run configuration for this project, on the Arguments tab, add

-Djava.library.path=${SJAVA_PATH}:/usr/local/R/lib/R/library/SJava/libs

as a VM argument.

Martin

>  Who can help me?
> Thanks
> 
> 


-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the R-help mailing list