我通过调用install.packages(“r
Java”)安装了r
Java – 没有看到任何问题
但是当我打电话:
library(rJava) .jinit()
我得到:
JavaVM: requested Java version ((null)) not available. Using Java at "" instead. JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib JavaVM FATAL: Failed to load the jvm library. Error in .jinit() : JNI_GetCreatedJavaVMs returned -1
我正在运行OSX:
Darwin MBP-2 14.5.0 Darwin Kernel Version 14.5.0: Tue Sep 1 21:23:09 PDT 2015; root:xnu-2782.50.1~1/RELEASE_X86_64 x86_64
我安装了以下Sun JDK:
$ls /Library/Java/JavaVirtualMachines/ jdk1.7.0_79.jdk jdk1.8.0_65.jdk
我的路径上有哪些Java?
$which java /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home//bin/Java
我也有JavaHome定义为:
$echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/
解决方法
这个解决方案
Cannot load R xlsx package on Mac OS 10.11
sudo R CMD javareconf install.packages("rJava",type='source')
为我工作