When I tried to run the R console in Eclipse, I got this error:
....Please make sure that R package \'rj\' (1.1 or compatible) is installed...
For Linux(Ubuntu) users: If you have oracle-java (7/8) installed. It'll be at this location /usr/lib/jvm
and sudo
access is required.
Create the file /etc/ld.so.conf.d/java.conf
with the following entries:
/usr/lib/jvm/java-8-oracle/jre/lib/amd64
/usr/lib/jvm/java-8-oracle/jre/lib/amd64/server
(Replace java-8-oracle with java-7-oracle depending on your java version)
Then:
sudo ldconfig
Restart RStudio and then install the rJava package.
OR
Also an alternative method is to export LD_LIBRARY_PATH
with the value of Java library path obtained from the command R CMD javareconf -e
and run install.packages
I found the solution:
export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-oracle/lib/amd64:/usr/lib/jvm/java-7-oracle/jre/lib/amd64/server
then
sudo R CMD javareconf
Note: The path (java-7-oracle) needs to be updated based on your Java installation.
When facing missing limjvm.so
errors make sure that the correct ldpaths
is picked up from the standard configuration in /etc/R
versus the one in /usr/lib/R/etc
.
Years later, I ended up on this question after searching for an error reported by R after I had unsuccessfully installed a package on that required shifting to Oracle's Java.
All I had to do to fix it was:
$ sudo R CMD javareconf
I fixed this by just running R with sudo, and then running install.packages('rJava`)
.