简体   繁体   English

在R中安装rJava或qdap的问题

[英]Issues with installing rJava or qdap in R

when trying to install qdap or rJava, it's always returning image not found error 尝试安装qdap或rJava时,总是返回找不到图像的错误

library(rJava) Error: package or namespace load failed for 'rJava': .onLoad failed in loadNamespace() for 'rJava', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so': dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so Reason: image not found Blockquote library(rJava)错误:“ rJava”的程序包或名称空间加载失败:.rLoad的loadNamespace()中的.onLoad失败,详细信息:调用:dyn.load(file,DLLpath = DLLpath,...)错误:无法加载共享对象'/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so':dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava /libs/rJava.so,6):未加载库:@ rpath / libjvm.dylib引用自:/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rJava/libs/rJava.so原因:图片找不到Blockquote

I followed every instruction on this earlier thread, still doesn't work, same error msg. 我在这个较早的线程上遵循了每条指令,仍然无法正常工作,出现同样的错误消息。

R version 3.4.0 (2017-04-21) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: OS X El Capitan 10.11.6 R版本3.4.0(2017-04-21)平台:x86_64-apple-darwin15.6.0(64位)运行于:OS X El Capitan 10.11.6

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib Matrix产品:默认BLAS:/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK:/Library/Frameworks/R.framework/Versions/3.4/Resources /lib/libRlapack.dylib

Uninstall all versions of Java available in your system. 卸载系统中可用的所有Java版本。 And freshly download the 64bit version of Java. 并立即下载Java的64位版本。 Then install "rJava". 然后安装“ rJava”。 This would probably resolve this issue. 这可能会解决此问题。 It worked for me. 它为我工作。

This could help: 这可以帮助:

Sys.setenv(JAVA_HOME="C:/Program Files/Java/jre1.8.0_112")

Change to your path to Java. 转到您的Java路径。

It might be worth to look here: 可能值得在这里查看:

http://www.owsiak.org/?p=3671 http://www.owsiak.org/?p=3671

I was struggling with R, rJava and Java for some time (macOS) and eventually I have figured out how to make it work quite smooth. 我在R,rJava和Java(macOS)上苦苦挣扎了一段时间,最终我想出了如何使它运行得相当平稳的方法。

There are few things you have to pay attention to: 您需要注意的几件事:

  • whether you use Oracle's Java or Apple's one 无论您使用Oracle的Java还是Apple的Java
  • whether you have JNI enabled inside JDK 是否在JDK中启用了JNI
  • whether R properly finds your JDK installation R是否可以正确找到您的JDK安装

Give it a try and see whether my steps will help you with this one. 尝试一下,看看我的步骤是否可以帮助您解决这一问题。

For the one having issues in relation to rJava or qdap installation, many of the fixes described in forums did not work for me. 对于那些与rJava或qdap安装有关的问题,论坛中描述的许多修复程序对我来说都不起作用。 However, the following was successful: 但是,以下成功:

https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra) https://github.com/MTFA/CohortEx/wiki/Run-rJava-with-RStudio-under-OSX-10.10,-10.11-(El-Capitan)-or-10.12-(Sierra)

I just changed for the latest version of r. 我只是换了最新版本的r。 Once rJava was correctly installed, qdap was installed without any problem. 正确安装rJava之后,就可以毫无问题地安装qdap了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM