0

I'm trying to install the rJava package (R 3.0.2, Ubuntu 14.04) and I get the following:

> install.packages('rJava')
...
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver    : ''
compiler    : '/usr/bin/javac'
header prep.: ''
cpp flags   : ''
java libs   : ''
configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.

Dutifully following the instructions gets me:

craig@craig-desktop:~$ sudo R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.7.0_55
Java home path   : /usr/lib/jvm/java-7-openjdk-i386/jre
Java compiler    : /usr/bin/javac
Java headers gen.: 
Java archive tool: 

trying to compile and link a JNI progam 
detected JNI cpp flags    : 
detected JNI linker flags : -L$(JAVA_HOME)/lib/i386/client -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c conftest.c    -o conftest.o
conftest.c:1:17: fatal error: jni.h: No such file or directory
 #include <jni.h>
             ^
compilation terminated.
make: *** [conftest.o] Error 1
Unable to compile a JNI program

FWIW, I built R from source rather than using the package manager because I needed the newest version. I've tried (re)installing openjdk-7-jdk, r-cran-rjava, libnative-platform-jni, and libatk-wrapper-java-jni (as wild guesses), all to no avail. What do I need to get JNI working?

cjolley
  • 441
  • 6
  • 15
  • You need the development environment (headers) of Java to get javah and jar. –  Jun 16 '14 at 07:04
  • UPDATE: there are a lot of recommended solutions out there -- this one worked for me: http://stackoverflow.com/questions/16438073/unable-to-install-rjava-in-r-3-0-in-ubuntu-13-04?rq=1 – cjolley Jun 16 '14 at 07:06

0 Answers0