java - Failed Installing or running rJava on Linux Ubuntu - Ask Ubuntu
i going ask myself question , answer it. i've been bugged installation of rjava many time , decided put problems in 1 thread , document on stackexchange.
i have run
export java_home=/usr/lib/...
,echo $java_home
shows correct location. sudo r cmd javareconf report error "invalid java_home invalid". happened?when run
require(rjava)
insudo r
, gives "can't load libjvm.so" or "xxx file doesn't exist" error,require(rjava)
works inr
.follows q2,
require(rjava)
works insudo r
not inr
.the output
echo $java_home
orecho $ld_library_path
run on terminal different ones run in rsystem("echo $java_home")
orsystem("echo $ld_library_path)
.which java should install? had jre installed didn't work.
require(rjava)
works in terminal r not rstudio server.
examine environment settings, i've found
export java_home=xxx
doesn't work. runcat /etc/environment
, check ifjava_home
variable set correct path. have copy , paste intendedjava_home
path , setjava_home
in/etc/environment
one.check if
$path
variable has*your_java_home_path*/bin
in it, , if has your_ld_library_path in it.$ld_library_path
1libjvm.so
in it. have no idea .so for, has caused me trouble.please refer https://stackoverflow.com/questions/25232624/r-package-rjava-only-loads-if-i-launch-r-with-sudo
doesn't helped me because met q2, not q3. might you.
solution same q2.
install 1 oracle website http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
don't run apt-get install xxx
. thought it's saving time got lot of things don't want.
- run
sudo rstudio-server restart
. still running old rsession when haven't reconfigured java yet.
what if still doesn't work?
completely uninstall java. following thread http://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html
then reinstall following a5 instructions. go /etc/environment
set path following a1 , a2.
Comments
Post a Comment