Error while loading rJava

前端 未结 2 1791
误落风尘
误落风尘 2020-12-03 06:05

I get an error when I\'d like to load rJava. JDK is installed. (I run R on a CentOS VM (cloudera demo vm cdh3u4))

> library(rJava)

Error : .onLoad failed         


        
2条回答
  •  清歌不尽
    2020-12-03 06:44

    For Ubuntu, 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 or java-7-openjdk-amd64 depending on your java version)

    Then:

    sudo ldconfig
    

    Restart RStudio and then install the rJava package.

提交回复
热议问题