码迷,mamicode.com
首页 > 数据库 > 详细

安装Oracle JDK 7.0与8.0 for Mac OS X后Eclipse启动报错的解决之道

时间:2014-10-19 01:26:05      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:jdk   eclipse   mac   64位   jvm   

启动 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. 

参考 https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361 之类的解决方法均是徒劳无功的,换 64 位版本的 Eclipse 才是正道。


http://www.java2class.net/bbs/viewthread.php?tid=258

安装Oracle JDK 7.0与8.0 for Mac OS X后Eclipse启动报错的解决之道

标签:jdk   eclipse   mac   64位   jvm   

原文地址:http://blog.csdn.net/yulimin/article/details/40249497

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!