在macos11.6上安装openjdk,直接解压,并设置环境变量JAVA_HOME;
然后下载并安装eclipse-2020-06,点击eclipse图标,一闪而过无法启动,通过命令行:open -n /Applications/Eclipse.app 启动显示如下:
解决方法:
1)查看java安装路径:
$ /usr/libexec/java_home -V
/User/mymac/Document/jdk1.8.0_312.jdk/Contents/Home
2)将jdk移动到/Library/Java/JavaVirtualMachines/下:
mv -r /User/mymac/Document/jdk1.8.0_312.jdk /Library/Java/JavaVirtualMachines/
$ /usr/libexec/java_home -V
/Library/Java/JavaVirtualMachines/jdk1.8.0_312.jdk/Contents/Home
3)在eclipse的安装目录中找到Info.plist 修改如下:
增加<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_312.jdk/Contents/Home/bin/java</string>