安装venneuler和/或rJava R包

时间:2016-10-24 23:28:55

标签: r install rjava

我正在尝试在linux上安装venneuler R包。

正在运行:install.packages("venneuler")会出现此错误:

configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK). Run
R CMD javareconf
as root to add Java support to R.

If you don't have root privileges, run
R CMD javareconf -e
to set all Java-related variables and then install rJava.

ERROR: configuration failed for package ârJavaâ
* removing â/home/nruns/R/rJavaâ
Warning in install.packages :
  installation of package ârJavaâ had non-zero exit status
ERROR: dependency ârJavaâ is not available for package âvenneulerâ
* removing â/home/nruns/R/venneulerâ
Warning in install.packages :
  installation of package âvenneulerâ had non-zero exit status

The downloaded source packages are in
    â/tmp/RtmpjiRTHN/downloaded_packagesâ

尝试安装rJava包会产生相同的错误。

然后我按照建议运行R CMD javareconf并收到此错误:

trying to compile and link a JNI program 
detected JNI cpp flags    : 
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG  -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -m64 -mtune=generic  -c conftest.c -o conftest.o
conftest.c:1:17: fatal error: jni.h: No such file or directory
 #include <jni.h>

我使用:

更新了java
sudo yum install java-1.8.0-openjdk

已完成正常但仍尝试安装venneuler

时遇到同样的错误

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

对于rjava,请尝试安装以下软件包。它帮助了我

  • libbz2-dev的
  • libpcre3-dev或libpcre2-dev
  • liblzma-dev的

    sudo apt-get install packagename