1. 程式人生 > >MAC 10.12.5 JDK+Eclipse安裝

MAC 10.12.5 JDK+Eclipse安裝

由於最近管理一個J2EE的專案,於是想在MAC上搭一下JAVA開發環境,期間遇到一些莫名其妙的問題,記錄如下。

(1)安裝JDK8後,首次啟動eclipse報錯“需要安裝JRE6”,解決方式如下:

開啟/Library/Java/JavaVirtualMachines/jdkXXXXX.jdk/Contents/Info.plist 按照如下配置,然後重啟計算機。

   <key>JVMCapabilities</key>

                <array>

                        <string>JNI</string>

                        <string>BundledApp</string>

                        <string>WebStart</string>

                        <string>Applets</string>

                        <string>CommandLine</string>

                </array>

(2)解決JRE6的問題後,起到Eclipse.app報錯“unable to locate its companion library”,解決方法如下:

編輯Eclipse.app/Contents/MacOS/eclipse.ini,將-startup和--launcher.library改為絕對路徑

-startup

/Users/diamond/programs/eclipse/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar

--launcher.library

/Users/diamond/programs/eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.101.v20120109-1504

(3)啟動eclipse後,報錯“cannot find /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bundle/Libraries/libserver.dylib, created jvm failed!
”,解決方法如下:

mkdir -p /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bundle/Libraries/

ln -s 

/Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/jre/lib/server/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home/bundle/Libraries/libserver.dylib