当前位置: 首页 > 面试题库 >

无法在ubuntu系统上安装rJava

经俊茂
2023-03-14
问题内容

我已经看到了一些与此相关的帖子…但是我看到的所有建议的解决方案似乎都不起作用....我在EC2实例中运行R并运行以下命令尝试安装rJava,但无济于事…任何帮助将不胜感激。

 > install.packages("rJava")
 Installing package(s) into ‘/home/ubuntu/R/library’
 (as ‘lib’ is unspecified)
 trying URL 'http://cran.stat.nus.edu.sg/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... /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 -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    : ''
compiler    : ''
header prep.: ''
cpp flags   : ''
java libs   : '-L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server -L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64 -L/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib/x86_64-linux-gnu/jni -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib/jni -L/lib -L/usr/lib -ljvm'
configure: error: Java Development Kit (JDK) is missing or not registered in R
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/ubuntu/R/library/rJava’
Warning in install.packages :
  installation of package ‘rJava’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpaEiskU/downloaded_packages’
> system("sudo R CMD javareconf")
Java interpreter : /usr/bin/java
Java version     : 1.6.0_24
Java home path   : /usr/lib/jvm/java-6-openjdk-amd64/jre
Java compiler    : not present
Java headers gen.: 
Java archive tool: 
Java library path: $(JAVA_HOME)/lib/amd64/server:$(JAVA_HOME)/lib/amd64:$(JAVA_HOME)/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -L$(JAVA_HOME)/lib/amd64 -L$(JAVA_HOME)/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib/x86_64-linux-gnu/jni -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib/jni -L/lib -L/usr/lib -ljvm
JNI cpp flags    :

Updating Java configuration in /etc/R
Done.

> install.packages("rJava")
[same as before, just skipping to the error parts...]
 java libs   : '-L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/server -L/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64 -L/usr/lib/jvm/java-6-openjdk-amd64/jre/../lib/amd64 -L/usr/java/packages/lib/amd64 -L/usr/lib/x86_64-linux-gnu/jni -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib/jni -L/lib -L/usr/lib -ljvm'
configure: error: Java Development Kit (JDK) is missing or not registered in R
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/ubuntu/R/library/rJava’
Warning in install.packages :
  installation of package ‘rJava’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpaEiskU/downloaded_packages’
> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C         LC_TIME=C            LC_COLLATE=C        
 [5] LC_MONETARY=C        LC_MESSAGES=C        LC_PAPER=C           LC_NAME=C           
 [9] LC_ADDRESS=C         LC_TELEPHONE=C       LC_MEASUREMENT=C     LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_2.15.1

问题答案:

在Ubuntu上获取rJava的最简单方法是从存储库中安装它,而不是尝试直接从CRAN中安装它。从命令行这应该可以解决问题

sudo apt-get install r-cran-rjava


 类似资料:
  • 在完成了所有的安装过程之后,我得到了以下错误: 我已经通过PowerShell手动安装了ubuntu。https://docs.microsoft.com/en-us/windows/wsl/install-manual 当我输入Ubuntu并点击enter时,我收到一条服务尚未启动的消息。

  • 本文向大家介绍mac上安装ubuntu双系统教程,包括了mac上安装ubuntu双系统教程的使用技巧和注意事项,需要的朋友参考一下 mac和ubuntu双系统 mac系统安装ubuntu双系统的方法, mac系统要安装ubuntu, 必须使用u盘作为启动盘, 在mac启动的时候引导mac安装ubuntu, 下面为详细的安装方法: 准备:   1:需要一个u盘作为引导盘; 2:使用mac的磁盘管理工

  • 问题内容: 我一直在尝试使用安装lxml ,但出现以下错误。我以前用过(在其他答案中建议),但我仍然遇到相同的错误。我没有使用control-c。 问题答案: 尝试以下操作来获得帮助:

  • 本文向大家介绍在Ubuntu系统上安装Nginx服务器的简单方法,包括了在Ubuntu系统上安装Nginx服务器的简单方法的使用技巧和注意事项,需要的朋友参考一下 安装 Nginx      如果你安装了 Apache ,并且此时 Apache 在运行,那么请先修改一下配置文件(没有的同学直接跳过):      然后按以下两处修改(为了不和 Apache 冲突):              此时,

  • 本文向大家介绍Ubuntu系统安装Ruby的三种方法,包括了Ubuntu系统安装Ruby的三种方法的使用技巧和注意事项,需要的朋友参考一下 Ruby是一个开源的动态编程语言,它有优美的语法,可用于构建可伸缩的Web应用程序。ruby gems可以很好地增强Ruby开发者的开发效率。 要在Ubuntu系统上安装Ruby,有几种方法,每种方法都只需几步就能搞定。 方法一:使用apt-get安装 可以直

  • 本文向大家介绍Linux Ubuntu系统上手动安装.NET Core SDK的方法,包括了Linux Ubuntu系统上手动安装.NET Core SDK的方法的使用技巧和注意事项,需要的朋友参考一下 前言 .NET发行至今已经过了十四个年头。随着版本的不断迭代更新,.NET在Windows平台上的表现也是越来越好,可以说Windows平台上所有的应用类型.NET几乎都能完成。 只是成也Wind