error: unable to load installed packages just now

前端 未结 11 1832
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 21:17

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...
相关标签:
11条回答
  • 2020-11-30 22:04

    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

    0 讨论(0)
  • 2020-11-30 22:05

    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.

    0 讨论(0)
  • 2020-11-30 22:05

    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.

    0 讨论(0)
  • 2020-11-30 22:08

    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

    0 讨论(0)
  • 2020-11-30 22:12

    I fixed this by just running R with sudo, and then running install.packages('rJava`).

    0 讨论(0)
提交回复
热议问题