Project

General

Profile

Actions

Task #12599

closed

Is it possible to install rJava on RStudioLab?

Added by Emmanuel Blondel almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
_InfraScience Systems Engineer
Category:
System Application
Target version:
Start date:
Oct 03, 2018
Due date:
% Done:

100%

Estimated time:
Infrastructure:
Production

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

Screen Shot 2018-10-10 at 00.06.15.png (832 KB) Screen Shot 2018-10-10 at 00.06.15.png Andrea Dell'Amico, Oct 10, 2018 12:47 AM
Actions #2

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.

Actions #3

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.

Actions #4

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
Actions #5

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.

Actions #6

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?

Actions #7

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

Actions #8

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.

Actions #9

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

Actions #10

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?

Actions #11

Updated by Emmanuel Blondel almost 7 years ago

Hi @andrea.dellamico@isti.cnr.it , the instances i've tried are:

Actions #12

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).

Actions #13

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?

Actions #14

Updated by Andrea Dell'Amico almost 7 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 8.91 MB)