Mac OS,JDK1.7(和1.8)不包含JNI_CreateJavaVM符号 [英] Mac OS, JDK1.7 (and 1.8) does not contain the JNI_CreateJavaVM symbol
问题描述
我需要通过JDK 1.7在Mac OS上运行Eclipse Kepler(这是PyDev插件所必需的).
I need to run Eclipse Kepler on Mac OS through a JDK 1.7 (This is required by the PyDev plugin).
问题是,尽管我已经成功安装了1.7 jdk并配置了eclipse.ini以使用它,但还是收到了错误消息
The problem is that although I have managed to install the 1.7 jdk and configured the eclipse.ini to use it I get the error
JVM共享库"/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin../jre/lib/server/libjvm.dylib"不包含JNI_CreateJavaVM符号.
The JVM shared library "/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin../jre/lib/server/libjvm.dylib" does not contain the JNI_CreateJavaVM symbol.
更新 这里的聪明人 https://github.com/joeferner/node-java/issues/90 声称足以将JNI添加到info.plist文件中的JVMCapabilities中,例如
UPDATE smart people here https://github.com/joeferner/node-java/issues/90 claim it is enough to add JNI to the JVMCapabilities in the info.plist file like
<key>JVMCapabilities</key>
<string>JNI</string>
但是我尝试过,但在我的情况下不起作用
But I tried it and it does not work in my case
推荐答案
右键单击Eclipse图标,然后选择显示软件包内容".在目录目录中,您将找到一个名为"Info.plist"的文件.向下滚动到文件底部,直到找到
Right click on the Eclipse icon and select 'show package contents'. Inside the contents directory you'll find a file called 'Info.plist'. Scroll down to the bottom of the file till you find this
<key>Eclipse</key>
<array>
<!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options,
or add a VM found via $/usr/libexec/java_home -V
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java</string>
<string>-vm</string><string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>
-->
请注意已注释掉的部分.将jdk路径声明移出注释部分.现在应该看起来像这样.
Notice the commented out section. Move the jdk path declaration out of the comments section. It should look like this now.
<key>Eclipse</key>
<array>
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java</string>
<!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options,
or add a VM found via $/usr/libexec/java_home -V
<string>-vm</string><string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>
-->
最后一步,浏览至/Library/Java/JavaVirtualMachines并检查其中存在的jdk软件包名称.替换上面命令中的jdk版本.
Last step, browse to /Library/Java/JavaVirtualMachines and check the jdk package name present there. Replace the jdk version in the above command with that.
/Library/Java/JavaVirtualMachines/{your_jdk_package_name}/Contents/Home/bin/java
可选:完成某些步骤后,在某些机器上,您可能必须关闭取景器,导航至eclipse文件夹,然后再次单击eclipse使其起作用.
Optional: On some machines you may have to close the finder after you've done all this, navigate to the eclipse folder and click on eclipse again for it to work.
这篇关于Mac OS,JDK1.7(和1.8)不包含JNI_CreateJavaVM符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!