Mac启动Eclipse提示Failed to create the Java Virtual Machine

电脑系统升级到Big Sur之后,原来正常的Eclipse打不开了,启动提示Failed to create the Java Virtual Machine错误。
在这里插入图片描述

在这里插入图片描述
出现这种情况,可以通过指定Java路径方式进行解决,首先需要找到Eclipsed的info.plist文件:/Application/Eclipse.app/Contents/info.plsit。通过文本编辑工具打开之后可以找到如下内容:

<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>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home/bin/java</string>
-->
<string>-keyring</string>
<string>~/.eclipse_keyring</string>
</array>

我们需要做的就是修改此部分内容,指定Java位置,需改后参考如下:

<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>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands/java</string>
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home/bin/java</string>
-->
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java</string>
<string>-keyring</string>
<string>~/.eclipse_keyring</string>
</array>

再次运行Eclipse可以正常启动
在这里插入图片描述

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 程序猿惹谁了 设计师:白松林 返回首页