我尝试在运行MRO-3.4.2的macOS High Sierra 10.13.3上安装XLConnectJars软件包,但它出现以下错误:
JavaVM: Failed to load JVM: /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
Error: package or namespace load failed for ‘XLConnectJars’:
.onLoad failed in loadNamespace() for 'XLConnectJars', details:
call: .jinit()
error: JNI_GetCreatedJavaVMs returned -1
Mac上java的问题似乎很平常,我尝试了很多但没有任何作用(我在stackoverflow或其他论坛中经历了几十个线程,但没有其他设置解决了我的问题)。
我设法安装了rJava包,它没有问题。
此外,当我在终端中运行R CMD javareconf时:
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version : 9.0.1
Java home path : /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
System Java on macOS
trying to compile and link a JNI program
detected JNI cpp flags : -I/System/Library/Frameworks/JavaVM.framework/Headers
detected JNI linker flags : -framework JavaVM
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/System/Library/Frameworks/JavaVM.framework/Headers -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -fPIC -DU_STATIC_IMPLEMENTATION -Wall -mtune=core2 -g -O2 -I/opt/X11/include -c conftest.c -o conftest.o
conftest.c:4:5: warning: 'JNI_CreateJavaVM' is deprecated
[-Wdeprecated-declarations]
JNI_CreateJavaVM(0, 0, 0);
^
/System/Library/Frameworks/JavaVM.framework/Headers/jni.h:1937:1: note:
'JNI_CreateJavaVM' has been explicitly marked deprecated here
JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
^
1 warning generated.
/usr/local/clang4/bin/clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/clang4/lib -o conftest.so conftest.o -framework JavaVM -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
JAVA_HOME : /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home
Java library path:
JNI cpp flags : -I/System/Library/Frameworks/JavaVM.framework/Headers
JNI linker flags : -framework JavaVM
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
其中“JNI_CreateJavaVM”似乎与包XLConnectJars的安装问题有关。
有人可以解释一下问题到底是什么吗?我该怎么做,我必须设置什么才能让它运行?
提前致谢。