在Mac上安装rJava时遇到问题;麻烦JNI数据类型 [英] Trouble installing rJava on Mac ; trouble with JNI data types
问题描述
RESOLVED !!
查看我的解决方案,以防此问题在未来帮助其他人。
错误
正如标题所描述的,它失败了。我收到的错误,当我尝试 install.packages('rJava')
从里面R是(与一些前面的好检查):
检查JNI程序是否可以编译...是
pre>
检查JNI数据类型... configure:error:一个或多个JNI类型不同从相应的本机类型。您可能需要使用非标准编译器标志或不同的编译器,以解决这个问题。
错误:程序包'rJava'配置失败
*删除'/usr/local/lib/R/3.2/site-library/rJava'
修正尝试
以下解决方案,没有一个对我有用:
-
-
export JAVA_HOME
在这种情况下,我没有做LD_LIBRARY_PATH,因为它似乎与Mac不相关。
我有以前曾有过 rJava
(和 RJDBC
)正确安装。
,实际问题是升级到OS X 10.11,El Capitan。]
配置
$ java -version
java版本1.8.0_45
> R.Version()
$ platform
[1]x86_64-apple-darwin15.0.0
$ version.string
[1]R版本3.2.2 -08-14)
Mac OS本身:
$ b b
系统版本:OS X 10.11.1(15B42)
我终于解决了这个问题,通过一个解决方案,我发现在这里。
新的Mac OS X(10.11,El Capitan)遇到问题包含env变量。
rJava
正确处理事情。这是我做了什么来解决它:
- 下载版本0.9-8(
rJava_0.9-8.tar .gz
)这里 -
从下载的源安装它:
$ R CMD INSTALL〜/ Downloads / rJava_0.9-8.tar.gz
(或放在任何地方)
$ b
RESOLVED!!
See my solution below, in case this question helps others in the future.
Error
As the title described, it it failing for me. The error I'm receiving, when I attempt to install.packages('rJava')
from inside R is (with some preceding good checks):
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 ‘/usr/local/lib/R/3.2/site-library/rJava’
Fix Attempts
I have checked and tried the following resolutions, none of which worked for me:
export JAVA_HOME
, however in this case, I did not do the LD_LIBRARY_PATH, as it did not seem relevant to a Mac.
No such luck, with any of these attempts.
I had previously had rJava
(and RJDBC
) installed properly.
[Edit: I later found out, the actual problem was upgrading to OS X 10.11, El Capitan.]
Configuration
$ java -version
java version "1.8.0_45"
> R.Version()
$platform
[1] "x86_64-apple-darwin15.0.0"
$version.string
[1] "R version 3.2.2 (2015-08-14)"
Mac OS itself:
System Version: OS X 10.11.1 (15B42)
I finally resolved this, via a solution I found here.
The new Mac OS X (10.11, El Capitan) has trouble with env variables.
The newest dev flavor of rJava
manages to handle things correctly. Here is what I did to resolve it:
- Download version 0.9-8 (
rJava_0.9-8.tar.gz
) from here Install it from the downloaded source:
$ R CMD INSTALL ~/Downloads/rJava_0.9-8.tar.gz
(Or wherever you put it)
That's all it took!
这篇关于在Mac上安装rJava时遇到问题;麻烦JNI数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!