Task #12599
closed
Is it possible to install rJava on RStudioLab?
100%
Description
trying to do an installation in my environment I get this:
./configure: line 3747: /usr/lib/jvm/default-java/jre/bin/java: No such file or directory
no
configure: error: Java interpreter '/usr/lib/jvm/default-java/jre/bin/java' does not work
ERROR: configuration failed for package ‘rJava’
- removing ‘/home/emmanuel.blondel/R/x86_64-pc-linux-gnu-library/3.4/rJava’ Warning in install.packages : installation of package ‘rJava’ had non-zero exit status
Files
Updated by Andrea Dell'Amico almost 7 years ago
- Tracker changed from Support to Task
- Status changed from New to In Progress
The problem is still the same (the JDK was updated from 7 to 8 in the meantime). I'm going to install the package globally.
Updated by Andrea Dell'Amico almost 7 years ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
rJava is going to be installed on every rstudio instance in the next minutes.
Updated by Emmanuel Blondel almost 7 years ago
What i got trying to run 'library(rJava)' (in RStudioLab
and RPrototypingLab
VREs)
Error: package or namespace load failed for ‘rJava’: .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/usr/local/lib/R/site-library/rJava/libs/rJava.so': libjvm.so: cannot open shared object file: No such file or directory
Updated by Andrea Dell'Amico almost 7 years ago
It seems that rJava
wants JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre"
, while that variable is usually JAVA_HOME="/usr/lib/jvm/java-8-oracle"
. I'm trying to find a way to set it into .Rprofile.
I'm using Sys.setenv
but it does not work. I'll let you know if I make any progress.
Updated by Andrea Dell'Amico almost 7 years ago
It's not even that. it seems that I have to setup a full java environment before running R CMD javareconf
. The command
export JAVA_HOME=/usr/lib/jvm/java-8-oracle ; export J2SDKDIR=/usr/lib/jvm/java-8-oracle ; export J2REDIR=/usr/lib/jvm/java-8-oracle/jre ; R CMD javareconf
fixed the configuration. @emmanuel.blondel1@gmail.com can you verify if it works for you now?
Updated by Emmanuel Blondel almost 7 years ago
still get the same error
library(rJava)
Error: package or namespace load failed for ‘rJava’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
libjvm.so: cannot open shared object file: No such file or directory
Updated by Andrea Dell'Amico almost 7 years ago
On what instance? I’ll try to reproduce from inside studio, because the library always loads successfully when I run R from a shell.
Updated by Emmanuel Blondel almost 7 years ago
I've tried on both RStudioLab and RPrototypingLab, and before i've restarted the R session in case
Updated by Andrea Dell'Amico almost 7 years ago
I just tried RStudioLab (my instance was rstudio1.d4science.org) and rJava loaded, here is a screenshot.
I've also tried RPrototypingLab and the load of the library fails from inside rstudio, but succeeds when running R from the shell. I don't know where a difference can be. @g.panichi@isti.cnr.it @gianpaolo.coro@isti.cnr.it do you have any clue?
Updated by Emmanuel Blondel almost 7 years ago
Hi @andrea.dellamico@isti.cnr.it , the instances i've tried are:
- http://ip-90-147-167-30.ct1.garrservices.it/ (from RStudioLab VRE)
- http://rstudio1-proto.d4science.org/ (from RPrototypingLab VRE) In both cases it fails
Updated by Andrea Dell'Amico almost 7 years ago
- Status changed from Feedback to In Progress
- % Done changed from 100 to 80
I'm still not able to find the reason why the load of the library fails from inside rstudio while it works from a shell (same user, same .Rprofile, same environment).
Updated by Andrea Dell'Amico almost 7 years ago
- Status changed from In Progress to Feedback
- % Done changed from 80 to 100
Now it's working for me on all the instances I have access to. Any feedback?
Updated by Andrea Dell'Amico almost 7 years ago
- Status changed from Feedback to Closed