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.
Asked
Active
Viewed 359 times
0
-
Possible duplicate of [R: rJava package install failing](http://stackoverflow.com/questions/3311940/r-rjava-package-install-failing) – Dec 22 '15 at 06:44
-
I have tried the solution but that did not work. – Jaishree Rout Dec 22 '15 at 06:47
-
It is exactly the same. – Dec 22 '15 at 06:47
-
I set the path to jre but it did not work for me. Again I set it to jdk and it is working fine. The issue is same. But, solution is different. – Jaishree Rout Dec 22 '15 at 06:50
1 Answers
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