R: rJava package install failing

后端 未结 17 1187
Happy的楠姐
Happy的楠姐 2020-11-22 16:28

When installing rJava using the install.packages(\"rJava\") command I get the following error:

checking Java support in R... present:
interprete         


        
17条回答
  •  无人及你
    2020-11-22 16:49

    This worked for me on Ubuntu 12.04 and R version 3.0

    cd /usr/lib/jvm/java-6-sun-1.6.0.26/include
    

    this is the directory that has jni.h

    Next create a soft link to another required header file (I'm too lazy to find out how to include more than one directory in the JAVA_CPPFLAGS option below):

    sudo ln -s linux/jni_md.h .
    

    Finally

    sudo R CMD javareconf JAVA_CPPFLAGS=-I/usr/lib/jvm/java-6-sun-1.6.0.26/include
    

提交回复
热议问题