当 Debian 中出现此 Java 问题时如何安装最新的 R?

当 Debian 中出现此 Java 问题时如何安装最新的 R?

我的建议

su 
apt-get purge r-base r-base-dev 
exit

wget https://cran.r-project.org/src/base/R-3/R-3.3.1.tar.gz
tar -zxvf R-3.3.1.tar.gz
su     
apt-get install libcurl4-openssl-dev # otherwise, error: configure: error: libcurl >= 7.28.0 library and headers are required with support for https in ./configure
./configure
make
...

之后的消息./configure一切正常,没有警告/错误;这里尾巴

R is now configured for x86_64-pc-linux-gnu

  Source directory:          .
  Installation directory:    /usr/local

  C compiler:                gcc -std=gnu99  -g -O2
  Fortran 77 compiler:       gfortran  -g -O2

  C++ compiler:              g++  -g -O2
  C++11 compiler:            g++  -std=c++11 -g -O2
  Fortran 90/95 compiler:    gfortran -g -O2
  Obj-C compiler:         

  Interfaces supported:      X11
  External libraries:        readline, curl
  Additional capabilities:   PNG, JPEG, NLS
  Options enabled:           shared BLAS, R profiling

  Capabilities skipped:      TIFF, cairo, ICU
  Options not enabled:       memory profiling

  Recommended packages:      yes

然而,我的makeroot 身份显然失败了,因为我需要 Open-JDK Java 来进行 SPSS 统计

** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (mgcv)
make[2]: Leaving directory '/home/masi/Downloads/R3.3/R-3.3.1/src/library/Recommended'
make[1]: Leaving directory '/home/masi/Downloads/R3.3/R-3.3.1/src/library/Recommended'
make[1]: Entering directory '/home/masi/Downloads/R3.3/R-3.3.1/src/library'
building/updating vignettes for package 'grid' ...
building/updating vignettes for package 'parallel' ...
building/updating vignettes for package 'utils' ...
make[1]: Leaving directory '/home/masi/Downloads/R3.3/R-3.3.1/src/library'
make[1]: Entering directory '/home/masi/Downloads/R3.3/R-3.3.1'
configuring Java ...
Java interpreter : /usr/bin/java
Java version     : 1.8.0_102
Java home path   : /usr/lib/jvm/jre-8-oracle-x64
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar

trying to compile and link a JNI program 
detected JNI cpp flags    : 
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
make[2]: Entering directory '/tmp/Rjavareconf.gPqbgX'
gcc -std=gnu99 -I/home/masi/Downloads/R3.3/R-3.3.1/include -DNDEBUG  -I/usr/local/include    -fpic  -g -O2  -c conftest.c -o conftest.o
conftest.c:1:17: fatal error: jni.h: No such file or directory
 #include <jni.h>
                 ^
compilation terminated.
/home/masi/Downloads/R3.3/R-3.3.1/etc/Makeconf:132: recipe for target 'conftest.o' failed
make[2]: *** [conftest.o] Error 1
make[2]: Leaving directory '/tmp/Rjavareconf.gPqbgX'
Unable to compile a JNI program

JAVA_HOME        : /usr/lib/jvm/jre-8-oracle-x64
Java library path: 
JNI cpp flags    : 
JNI linker flags : 
Updating Java configuration in /home/masi/Downloads/R3.3/R-3.3.1
Done.

make[1]: Leaving directory '/home/masi/Downloads/R3.3/R-3.3.1'

我的最终解决方案基于 JdeBP 的答案 - 成功

su
apt-get install -t jessie-backports r-base r-base-dev

操作系统:Debian 8.5 64 位
Linux 内核:向后移植
Asus Zenbook UX303UA 4.6

答案1

实际上,Debian 软件包的页面r-base(例如)在这里:

添加“杰西向后移植” 到您的sources.list,您至少可以通过 APT 升级到 R 版本 3.3.1。

相关内容