简体   繁体   English

在具有J2SE 6.0的Mac OS上启动Eclipse MAT时,JVM终止

[英]JVM terminates when launching Eclipse MAT on Mac OS with J2SE 6.0

I have recently discovered the incredibly useful Eclipse Memory Analysis Tool , which makes quick work of finding memory leaks in Java applications. 我最近发现了极其有用的Eclipse Memory Analysis Tool ,它可以快速地发现Java应用程序中的内存泄漏。 Unfortunately, after switching my JDK to 1.6 (under Mac OS 10.5), the JVM terminates immediately upon startup. 不幸的是,在将我的JDK切换到1.6(在Mac OS 10.5下)之后,JVM在启动时立即终止。 All that appears is a dialog stating "JVM terminated" with "Exit code = -1". 出现的仅是一个对话框,指出“ JVM已终止”和“退出代码= -1”。

Anyone else encounter this one? 还有其他人遇到吗? Perhaps there is a way to configure it to use a different JDK? 也许有一种方法可以配置它以使用其他JDK? (such as 1.5: which it was shown to be compatible with) (例如1.5:表明与之兼容)

To configure Eclipse to use another VM use this command line: 要将Eclipse配置为使用其他VM,请使用以下命令行:

eclipse -vm <path to java>

You can also specify the path in Eclipse.app/Contents/Info.plist. 您还可以在Eclipse.app/Contents/Info.plist中指定路径。 There is a section like this: 有这样的部分:

<!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options:
    <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/java</string>
    <string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java</string>
-->

For the Memory Analyzer the you can find the Info.plist file under MemoryAnalyzer.app/Contents. 对于Memory Analyzer,您可以在MemoryAnalyzer.app/Contents下找到Info.plist文件。

The official Java 6 for the Mac only has a 64 bit data model. 适用于Mac的官方Java 6仅具有64位数据模型。 Unfortunately, Eclipse uses Carbon on the Mac which is only available in 32 bits. 不幸的是,Eclipse在Mac上仅使用32位版本的Carbon。 In short, it is impossible to run Eclipse with the official Java 6 distribution. 简而言之,使用正式的Java 6发行版运行Eclipse是不可能的。

The classical solution to this is to set the default VM to Java 5, and then choose Java 6 as the JRE/JDK within Eclipse. 经典的解决方案是将默认VM设置为Java 5,然后在Eclipse中选择Java 6作为JRE / JDK。

If you really need to run Eclipse with Java 6, then you could take a look at SoyLatte which is a build of OpenJDK which both supports 32 and 64 bit modes. 如果您确实需要使用Java 6运行Eclipse,则可以看看SoyLatte ,它是OpenJDK的构建,它同时支持32位和64位模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM