Unable to install rJava in R 3.0 in Ubuntu 13.04

后端 未结 4 1759
忘了有多久
忘了有多久 2020-12-02 14:34

I am not able to call rJava package in R 3.0. I got the following message

Error: package ‘rJava’ was built before R 3.0.0: please r         


        
相关标签:
4条回答
  • 2020-12-02 14:40

    I was also facing same error which was on RHEL8.1 & i resolved it as follows:

    yum --enablerepo=* install java-1.8* 
    

    later i ran same command which was giving me error logs of R server.

    R CMD javareconf
    

    which turns into following output.

    0 讨论(0)
  • 2020-12-02 14:44

    Installing rJava from the distribution packages as proposed in this askUbuntu answer also works:

    sudo apt-get install r-cran-rjava
    

    NOTE: tried from a Debian system.

    0 讨论(0)
  • 2020-12-02 14:52

    For those getting the error:

    error: unable to load shared object '/some/dir/rJava/libs/rJava.so': libjvm.so: 
    cannot open shared object file: No such file or directory
    

    I solved the error locating the library in the system and linking them to /usr/lib:

    $sudo updatedb
    $locate libjvm.so
    /usr/lib/debug/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
    /usr/lib/debug/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/zero/libjvm.so
    /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/jamvm/libjvm.so
    /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so
    /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/zero/libjvm.so
    $sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so /usr/lib/ 
    
    0 讨论(0)
  • I ran into the exact same issue. My solution was to install the openjdk-7-* via

    sudo apt-get install openjdk-7-*
    

    Followed that with

    sudo R CMD javareconf
    

    and I was then able to install rJava in R via install.packages("rJava").

    While perhaps not the most elegant solution it appears to have solved my problems with getting rJava to work.

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