简体   繁体   中英

Rhive and rJava ERROR: configuration failed for package ‘rJava’ in centos/unable to load the library of rjava

Getting error while installing "rJava" after setting the path of java home. After setting the path of java home able to install "rJava" in R console but not from Rstudio. Unable to load the library of "rJava" package in R studio.

I have got this error twice while working in two different system.

The main problem is with the path of JAVA_HOME. First if any rjava is installed need to uninstall it then need to set the path and then need to to restart R.

First time I solve this error by setting the path as

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64/jre
export PATH=$PATH:$JAVA_HOME/bin
sudo /usr/bin/R CMD javareconf

But second time it would not work . Second time I have set the path to jdk instead of jre from the root. And It worked.

  sudo export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.91.x86_64   
  sudo export PATH=$PATH:$JAVA_HOME/bin
  sudo /usr/bin/R CMD javareconf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM