我正在尝试安装rJava包R 2.14.1-9.1上OpenSUSE 11.3。我看过this的问题,但它是针对Ubuntu的。我已安装Sun JDK并重新配置系统以使用它。在R 2.14和OpenSUSE下安装rJava失败
[email protected]:~> java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode)
[email protected]:~>
EDIT 1: 更新了JDK和JRE。现在有稍微不同的错误,当我运行install.packages("rJava")
,我得到错误下面的输出(新的错误张贴在大胆年底):
> install.packages("rJava")
Installing package(s) into ‘/home/admin/R/i686-pc-linux-gnu-library/2.14’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
trying URL 'http://ftp.iitm.ac.in/cran/src/contrib/rJava_0.9-3.tar.gz'
Content type 'application/x-gzip' length 537153 bytes (524 Kb)
opened URL
==================================================
downloaded 524 Kb
* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc -std=gnu99 supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/../include -I/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/../include/linux'
java libs : '-L/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/lib/i386/client -L/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/lib/i386 -L/usr/lib/jvm/java-1.6.0-sun-1.6.0/jre/../lib/i386 -L/usr/java/packages/lib/i386 -L/lib -L/usr/lib -ljvm'
checking whether JNI programs can be compiled... yes
checking JNI data types... configure: error: One or more JNI types differ from the corresponding native type. You may need to use non-standard compiler flags or a different compiler in order to fix this.
ERROR: configuration failed for package ‘rJava’
* removing ‘/home/admin/R/i686-pc-linux-gnu-library/2.14/rJava’
The downloaded packages are in
‘/tmp/RtmpIFKEha/downloaded_packages’
Warning message:
In install.packages("rJava") :
installation of package ‘rJava’ had non-zero exit status
>
新的错误行:
检查JNI数据类型...配置:错误:一个或多个JNI类型与相应的本机类型不同。您可能需要使用非标准的编译器标志或不同的编译器才能解决此问题。
我确实运行R CMD javareconf
为root
。它将cpp标志字段留空。我知道这是失败的原因之一,但不知道如何解决。
我已经试过这个安装命令与dependencies = TRUE选项,并通过明确指定回购(以及回购=“等等等等”)。没有工作。
我不知道如何做OpenSUSE的更新。但是看起来像SUSE没有简单的方法来实现这一点,与Ubuntu不同的是,步骤明确给出了here。
任何帮助表示赞赏。
所以....你有没有尝试按照错误信息中的布局? – 2012-01-17 17:04:10
@JackManey:我确实将'R CMD javareconf'作为'root'运行。它将'cpp flags'字段留空。我知道这是失败的原因之一,但不知道如何解决。 ( – Bhushan 2012-01-17 17:08:52
)您是否安装了JDK(而不仅仅是JRE)? – 2012-01-17 17:13:31