[R] Java to R interface.

Cedrick Johnson cedrick at cedrickjohnson.com
Fri Sep 25 14:45:51 CEST 2009


You could also try Rserve

http://www.rforge.net/Rserve/

-cj


vikrant S wrote:
> I want to call R functions from Java. I read a couple of forums that said to
> install package rJava in R.
> However I am not able to install rJava package in linux Ubuntu.I tried with
> two commands.
> One is
> install.packages("rJava")
>
> and another I downloaded the rJava_0.7-0.tar.gz file from R site.
> and gave the command R CMD INSTALL rJava_0.7-0.tar.gz.
>  I got the followin Errors :- 
>
>
> Warning in install.packages("rJava") :
>   argument 'lib' is missing: using
> '/home/vikrant/R/i486-pc-linux-gnu-library/2.9'
> trying URL 'http://cran.uk.r-project.org/src/contrib/rJava_0.7-0.tar.gz'
> Content type 'application/x-gzip' length 249486 bytes (243 Kb)
> opened URL
> ==================================================
> downloaded 243 Kb
>
> * Installing *source* package ‘rJava’ ...
> mv: cannot move `/home/vikrant/R/i486-pc-linux-gnu-library/2.9/rJava' to
> `/home/vikrant/R/i486-pc-linux-gnu-library/2.9/00LOCK/rJava': Permission
> denied
> checking for gcc... gcc -std=gnu99
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables... 
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc -std=gnu99 accepts -g... yes
> checking for gcc -std=gnu99 option to accept ISO C89... none needed
> checking how to run the C preprocessor... gcc -std=gnu99 -E
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for ANSI C header files... yes
> checking for sys/wait.h that is POSIX.1 compatible... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking for string.h... (cached) yes
> checking sys/time.h usability... yes
> checking sys/time.h presence... yes
> checking for sys/time.h... yes
> checking for unistd.h... (cached) yes
> checking for an ANSI C-conforming const... yes
> checking whether time.h and sys/time.h may both be included... yes
> configure: checking whether gcc -std=gnu99 supports static inline...
> yes
> checking Java support in R... present:
> interpreter : '/usr/bin/java'
> archiver    : '/usr/bin/jar'
> compiler    : '/usr/bin/javac'
> header prep.: '/usr/bin/javah'
> cpp flags   : '-I/usr/lib/jvm/java-6-openjdk/jre/../include'
> java libs   : '-L/usr/lib/jvm/java-6-openjdk/jre/lib/i386/client
> -L/usr/lib/jvm/java-6-openjdk/jre/lib/i386
> -L/usr/lib/jvm/java-6-openjdk/jre/../lib/i386 -L
> -L/usr/java/packages/lib/i386 -L/lib -L/usr/lib -L/usr/lib/jni -ljvm'
> checking whether JNI programs can be compiled... yes
> checking JNI data types... configure: error: One or more JNI types differ
> from the corresponding native type. You may need to use non-standard
> compiler flags or a different compiler in order to fix this.
> ERROR: configuration failed for package ‘rJava’
>
> Please Help me to install rJava. and anyone Could u suggest Is there any
> better way to call R from Java
> And provide me the tutorial for the same ?
> Thanks in Advance
>
>




More information about the R-help mailing list