Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在centos R中安装rJava_Java_R_Bash_Hdfs_Rjava - Fatal编程技术网

无法在centos R中安装rJava

无法在centos R中安装rJava,java,r,bash,hdfs,rjava,Java,R,Bash,Hdfs,Rjava,Iam无法在centos R中安装rJava,它是安装rhdfs的基础。请帮助并查看我在安装rJava时获得的输出 > install.packages( c("rJava")) Installing package into ‘/home/training/R/x86_64-redhat-linux-gnu-library/3.1’ (as ‘lib’ is unspecified) --- Please select a CRAN mirror for use in this sess

Iam无法在centos R中安装rJava,它是安装rhdfs的基础。请帮助并查看我在安装rJava时获得的输出

> install.packages( c("rJava"))
Installing package into ‘/home/training/R/x86_64-redhat-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://ftp.iitm.ac.in/cran/src/contrib/rJava_0.9-6.tar.gz'
Content type 'application/x-gzip' length 567515 bytes (554 Kb)
opened URL
==================================================
downloaded 554 Kb

* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -m64 -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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 -m64 -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/java/jdk1.6.0_31/jre/../include -I/usr/java/jdk1.6.0_31/jre/../include/linux'
java libs   : '-L/usr/java/jdk1.6.0_31/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... yes
checking whether -Xrs is supported... yes
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/training/R/x86_64-redhat-linux-gnu-library/3.1/rJava’

The downloaded source packages are in
    ‘/tmp/Rtmp1RKjkQ/downloaded_packages’
Warning message:
In install.packages(c("rJava")) :
  installation of package ‘rJava’ had non-zero exit status
请在下面找到我从R CMD javareconf-ed获得的信息,它显示了我在bash.profile文件中给出的正确路径。请让我知道如何安装rJava和rhdfs

$ R CMD javareconf -ed
Java interpreter : /etc/alternatives/java_sdk_openjdk/jre/bin/java
Java version     : 1.6.0_30
Java home path   : /etc/alternatives/java_sdk_openjdk
Java compiler    : /etc/alternatives/java_sdk_openjdk/bin/javac
Java headers gen.: /etc/alternatives/java_sdk_openjdk/bin/javah
Java archive tool: /etc/alternatives/java_sdk_openjdk/bin/jar

trying to compile and link a JNI progam 
detected JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
detected JNI linker flags : -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server -ljvm
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/etc/alternatives/java_sdk_openjdk/include -I/etc/alternatives/java_sdk_openjdk/include/linux -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic  -c conftest.c -o conftest.o
gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o conftest.so conftest.o -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server -ljvm -L/usr/lib64/R/lib -lR


JAVA_HOME        : /etc/alternatives/java_sdk_openjdk
Java library path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server
JNI cpp flags    : -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JNI linker flags : -L/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server -ljvm
Updating Java configuration in /usr/lib64/R
/usr/lib64/R/bin/javareconf: line 405: /usr/lib64/R/etc/Makeconf.new: Permission denied
*** cannot create /usr/lib64/R/etc/Makeconf.new
*** Please run as root if required.

我已卸载并重新安装了R以执行此操作,但仍遇到相同的错误,请帮助如何完成此操作。

此问题已通过以下说明解决:

$export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.55.x86_64/jre
$export PATH=$PATH:$JAVA_HOME/bin
$sudo /usr/bin/R CMD javareconf
$R
这很好,我能够在centos上安装rhdfs