0

I have installed java into my linux system, and below is the details.

hduser@ubuntu:~$ java -version
java version "1.7.0_101"
OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.14.04.1)
OpenJDK Client VM (build 24.95-b01, mixed mode, sharing)
hduser@ubuntu:~$ echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-i386
hduser@ubuntu:~$ R CMD javareconf -e
Java interpreter : /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java
Java version     : 1.7.0_101
Java home path   : /usr/lib/jvm/java-7-openjdk-i386
Java compiler    : /usr/lib/jvm/java-7-openjdk-i386/bin/javac
Java headers gen.: /usr/lib/jvm/java-7-openjdk-i386/bin/javah
Java archive tool: /usr/lib/jvm/java-7-openjdk-i386/bin/jar

trying to compile and link a JNI progam 
detected JNI cpp flags    : -I$(JAVA_HOME)/include
detected JNI linker flags : -L$(JAVA_HOME)/jre/lib/i386/client -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-7-openjdk-i386/include     -fpic  -O3 -pipe  -g  -c conftest.c -o conftest.o
gcc -std=gnu99 -shared -o conftest.so conftest.o -L/usr/lib/jvm/java-7-openjdk-i386/jre/lib/i386/client -ljvm -L/usr/lib/R/lib -lR

The following Java variables have been exported:
JAVA_HOME JAVA JAVAC JAVAH JAR JAVA_LIBS JAVA_CPPFLAGS JAVA_LD_LIBRARY_PATH
Running: /bin/bash

but when I try to execute the below command in R Studio, i get a success message, but the package is not getting installed.

install.packages("rJava") Installing package into ‘/home/chetan/R/i686-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified)

The downloaded source packages are in ‘/tmp/RtmpuzTGKK/downloaded_packages’

But the package is not getting installed. Any help?

  • 1
    So you seem to have a working java installation. That's good. What is the output of R when you run install.packages("rJava")? Also, is there any difference if you execute the code within RStudio or in an R shell? How do you know that the package is not installed if you don't receive an error message? – RHertel Aug 09 '16 at 13:13
  • Possible duplicate of [R: rJava package install failing](http://stackoverflow.com/questions/3311940/r-rjava-package-install-failing) – Daniel Fischer Aug 09 '16 at 13:51

0 Answers0