0

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.

Jaishree Rout
  • 382
  • 5
  • 17

1 Answers1

1

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
Jaishree Rout
  • 382
  • 5
  • 17