This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem to install "rJava" in R.

Dear all,

I am trying to install "rJava" into R but getting following errors. OS= centOS; R version = R-3.2.3

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   : ''
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

Then I tried with

locate jni.h
/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.95-2.6.4.0.el7_2.x86_64/include/jni.h

and run

[root@localhost ~]# R CMD javareconf
Java interpreter : /usr/bin/java
Java version     : 1.8.0_71
Java home path   : /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-2.b15.el7_2.x86_64/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar

trying to compile and link a JNI program
detected JNI cpp flags    :
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/SoftwareDownload/R-3.2.3/include -DNDEBUG  -I/usr/local/include -fpic  -g -O2  -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

JAVA_HOME        : /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.71-2.b15.el7_2.x86_64/jre
Java library path:
JNI cpp flags    :
JNI linker flags :
Updating Java configuration in /usr/SoftwareDownload/R-3.2.3
Done.
r shell bash

Hello unique379!

We believe that this post does not fit the main topic of this site.

Not a bioinformatics question, please ask stackoverflow

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

Ram's right - although this is likely stopping you from doing your Bioinformatic analysis, we are all better off if these sorts of questions are left to their dedicated spaces on StackOverflow, etc.

Having said that, I find that if you are going through dependancy hell - don't keep going. Instead I suggest downloading/installing the Anaconda package, and from anaconda installing rjava via https://anaconda.org/r/r-rjava

It might be lame, but if it gets you being productive in 30 minutes vs 3 days, its worth it.

0 answers

No answers yet.

Log in to answer this question.