Question: (Closed) Problem to install "rJava" in R.
0
gravatar for unique379
3.1 years ago by
unique37970
Spain
unique37970 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).
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/j                                              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-1.8.0.71-2.b15.el7_2.x86_64/j                                              re
Java library path:
JNI cpp flags    :
JNI linker flags :
Updating Java configuration in /usr/SoftwareDownload/R-3.2.3
Done.

bash shell R • 3.1k views
ADD COMMENTlink written 3.1 years ago by unique37970

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!

ADD REPLYlink written 3.1 years ago by RamRS20k
1

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.

ADD REPLYlink written 3.1 years ago by John12k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

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