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.

  1. 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?

  2. when run require(rjava) in sudo r, gives "can't load libjvm.so" or "xxx file doesn't exist" error, require(rjava) works in r.

  3. follows q2, require(rjava) works in sudo r not in r.

  4. the output echo $java_home or echo $ld_library_path run on terminal different ones run in r system("echo $java_home") or system("echo $ld_library_path).

  5. which java should install? had jre installed didn't work.

  6. require(rjava) works in terminal r not rstudio server.

  1. examine environment settings, i've found export java_home=xxx doesn't work. run cat /etc/environment , check if java_home variable set correct path. have copy , paste intended java_home path , set java_home in /etc/environment one.

  2. check if $path variable has *your_java_home_path*/bin in it, , if has your_ld_library_path in it. $ld_library_path 1 libjvm.so in it. have no idea .so for, has caused me trouble.

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

  4. solution same q2.

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

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

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User