rJava fails to install (MacOS, Red Hat)

后端 未结 2 1786
你的背包
你的背包 2021-02-06 13:06

I am experiencing the same rJava problem that many other people seem to of had at one point or another. The error occurs when R CMD INSTALL tests whether JNI progra

2条回答
  •  死守一世寂寞
    2021-02-06 13:55

    I am using Redhat Linux 7.1

    I was getting the same problem as above and I performed the following steps

    1) Edit /usr/lib64/R/etc/Renviron and add "CPPFLAGS=${CPPFLAGS-'-ldl'}" to the end of the file

    2) Then find the java home and set it like below ( set java home till /jre)

    $export JAVA_HOME=/usr/lib/jvm/java-1.7.1-ibm-1.7.1.3.10-1jpp.1.el7_1.x86_64/jre
    $export PATH=$PATH:$JAVA_HOME/bin
    $R CMD javareconf
    

    3) invoke R from commandline

    $R
    > install.packages("rJava")
    > install.packages("RJDBC",dep=TRUE)
    > q()
    Save workspace image? [y/n/c]: y
    

提交回复
热议问题