发布于 2014-12-07 07:20:22 | 5326 次阅读 | 评论: 1 | 来源: PHPERZ
Eclipse编辑器
Eclipse 是一个开放源代码的、基于Java的可扩展开发平台。就其本身而言,它只是一个框架和一组服务,用于通过插件组件构建开发环境。幸运的是,Eclipse 附带了一个标准的插件集,包括Java开发工具(Java Development Kit,JDK)。
本文为大家讲解的是eclipse错误:The JVM shared library "XXXX" does not contain the JNI_CreateJavaVM symbol.解决方法,感兴趣的同学参考下。
错误描述:
启动 Eclipse 时,直接报错
The JVM shared library "/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/../jre/lib/server/libjvm.dylib" does not contain the JNI_CreateJavaVM symbol.
Unable to find any JVMs matching architecture "i386".
eclipse[526:14077] Error loading /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/MacOS/libjli.dylib: dlopen(/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/MacOS/libjli.dylib, 265): no suitable image found. Did find:
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/MacOS/libjli.dylib: mach-o, but wrong architecture
原因分析:
既然报 wrong architecture 错,就看看这两个文件到底是什么状况:
通过执行 lipo -info /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/../jre/lib/server/libjvm.dylib
Architectures in the fat file: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/../jre/lib/server/libjvm.dylib are: x86_64
以及 lipo -info /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/MacOS/libjli.dylib
Non-fat file: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/MacOS/libjli.dylib is architecture: x86_64
清楚地显示 architecture: x86_64,于是乎,真正的根源找到了,是因为Eclipse是32位的,而Oracle JDK 7.0与8.0均为64位的,
解决方法:
解决的问题很简单,下载Eclipse 64位For Mac OS X即可。
因为 /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -d32 -version 执行的结果为:
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.