0

I am trying to install "rJava" in a linux machine.

Current R-version is : R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"

java is already installed and JAVA_HOME variable is set to : /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64/

should i need to install jdk or something?

It is giving me the following error. Please help me out.

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc -std=gnu99 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.101-3.b13.el7_2.x86_64/jre/bin/java'
archiver    : ''
compiler    : ''
header prep.: ''
cpp flags   : ''
java libs   : ''
configure: error: Java Development Kit (JDK) is missing or not registered in R
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.

If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.

ERROR: configuration failed for package ‘rJava’
* removing ‘/root/miniconda2/lib/R/library/rJava’

The downloaded source packages are in
        ‘/tmp/RtmpeFQ9dA/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In download.file(url, destfile = f, quiet = TRUE) :
  URL 'https://cran.r-project.org/CRAN_mirrors.csv': status was 'SSL connect error'
2: In install.packages("rJava") :
  installation of package ‘rJava’ had non-zero exit status
DileepGogula
  • 331
  • 5
  • 20
  • have you seen these lines: `If you don't have root privileges, run R CMD javareconf -e to set all Java-related variables and then install rJava.` ? – loki Sep 16 '16 at 10:07
  • first of all thanks for the quick response :) . I am running this as a root user. so, Should i run that command? Because i haven't changed any of the java configurations. – DileepGogula Sep 16 '16 at 10:09
  • Could [this](http://stackoverflow.com/a/14788468/2416535) help? – jakub Sep 16 '16 at 10:24
  • thanks for the suggestion. Will try and update you – DileepGogula Sep 16 '16 at 10:39
  • I cannot install using yum because it is not exposed to internet and i manually moved java and set JAVA_HOME. But i am still getting the same error. – DileepGogula Sep 16 '16 at 10:56
  • In case you are on Debian/Ubuntu, just di `sudo apt-get install r-cran-rjava` and things should work out of the box -- they do for many of us. But I see you mixing things up with Conda, and _there be dragons_ ... That is simply less tested, so you may need to do the basics. – Dirk Eddelbuettel Sep 16 '16 at 12:17
  • yep that's the problem :( . This rJava package is being used in some piece of the R-Code and that is being used inside python code. Which is running using rpy2 package of python. – DileepGogula Sep 16 '16 at 14:23

0 Answers0