0

An open source R package I am planning to use uses RJDBC. When I tried to install RJDBC using

install.packages("RJDBC")

I get an error indicating that rJava is not installed. Tried installing rJava using

install.packages("rJava")

But that resulted in error

checking whether JNI programs can be compiled... configure: error: Cannot compile a simple JNI program. See config.log for details.

Make sure you have Java Development Kit installed and correctly registered in R.
If in doubt, re-run "R CMD javareconf" as root.

ERROR: configuration failed for package ‘rJava’
* removing ‘/home/john/R/x86_64-pc-linux-gnu-library/3.5/rJava’
Warning in install.packages :
  installation of package ‘rJava’ had non-zero exit status

The downloaded source packages are in
    ‘/store/tmp/Rtmp0teUWN/downloaded_packages’ 

Found this SO question and tired almost all the suggestions without luck.

Logged in as root on the server using sudo su

Ran

R CMD javareconf

echo JAVA_HOME printed empty. So used the value from output of R CMD javareconf

ran R CMD javareconf -ed

then from R console ran

install.packages("rJava")

This seems to have installed the package and I assumed this was done for all users. Restarted R studio server

From a new session in R Studio tried to install RJDBC and got error stating rJava is not installed.

Running R CMD javareconf seems to recognize JAVA home paths but installation of rJava as a non-root user fails.

Highly appreciate any leads.

rams
  • 6,381
  • 8
  • 46
  • 65
  • What is the output of `installed.packages()["rJava", "LibPath"]` when run from an R console of the user that installed `rJava`? – Ralf Stubner Feb 16 '19 at 09:11
  • @RalfStubner as `root` I get `/usr/lib64/R/library` As any other user, I get `index out of bounds` indicating it's not installed. – rams Feb 18 '19 at 12:20
  • Interesting, have the other users the necessary rights to read `/usr/lib64/R/library/rJava`? – Ralf Stubner Feb 18 '19 at 12:46
  • @RalfStubner it appears so. `/usr/lib64/R/library/rJava` has `drwxr-xr-x` Am I not reading this right? – rams Feb 18 '19 at 13:38
  • Maybe ask on https://community.rstudio.com. SO does not lend itself to the back and forth that seems to be required here. – Ralf Stubner Feb 18 '19 at 16:27

0 Answers0