Question: (Closed) Problem to install "rJava" in R.
gravatar for unique379
4.8 years ago by
unique37990 wrote:

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).
R CMD javareconf

##Then I tried with

locate 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-                                              re
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/in                                              clude    -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-                                              re
Java library path:
JNI cpp flags    :
JNI linker flags :
Updating Java configuration in /usr/SoftwareDownload/R-3.2.3

bash shell R • 4.3k views
ADD COMMENTlink written 4.8 years ago by unique37990

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.


ADD REPLYlink written 4.8 years ago by _r_am31k

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

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

ADD REPLYlink modified 11 months ago by _r_am31k • written 4.8 years ago by John12k
Please log in to add an answer.
The thread is closed. No new answers may be added.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1777 users visited in the last hour