Not able to run Eclipse on macOS Big Sur

Mac升级到macOS Big Sur版本之后,Eclipse启动不了,解决如下:

1. 报错信息:

2. 终端运行:/usr/libexec/java_home -V
(base) MacBook-Pro:bin gavin$ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
1.8.152.16 (x86_64) “Oracle Corporation” – “Java” /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
1.8.0_152 (x86_64) “Oracle Corporation” – “Java SE 8” /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
1.7.0_80 (x86_64) “Oracle Corporation” – “Java SE 7” /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

3. 编辑Eclipse的Info.plist文件:
vim /Applications/Eclipse.app/Contents/Info.plist
添加如下内容到截图所示位置,具体内容根据第2步列出的实际路径更新:
-vm/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bin/java

4. 可以正常启动Eclipse了

注意1:最新版本的Eclipse已经不支持JDK7了,必须JDK8以上

注意2:也可以安装AdoptOpenJDK版本,下载链接和安装方式如下,不是必须:
https://adoptopenjdk.net/archive.html?variant=openjdk8&jvmVariant=hotspot
This package will install:
• AdoptOpenJDK 1.8.0_275-b01 to /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk

参考资料:
https://stackoverflow.com/questions/62647625/not-able-to-run-eclipse-on-macos-big-sur
https://wolfpaulus.com/java-on-macos-big-sur/

欢迎关注我的微信公众号:

 

如无特殊说明,文章均为本站原创,转载请注明出处!

发表评论

邮箱地址不会被公开。 必填项已用*标注