星期三, 5月 30, 2012

Mac lion Eclipse 設定 JDK7

在lion安裝完JDK7後,它的路徑已經先之前安裝的路徑不一樣了。
目前預設的安裝目錄是在
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home

之後打開Eclipse後,透過偏好設定的JAVA中的Installed JREs,指定新的JDK就可以了。


找到的參考資料
If you are a Java developer who wants to do Java development on Mac OS X 10.7, here are a few not-so-tricky steps to follow to get going:
  1. Go to http://connect.apple.com and sign in with your Apple ID (developer account may be required – it’s free).
  2. From the list titled “Downloads for Apple Developers”, select the item labeled “Java for Mac OS X 10.7 Update 1 Developer Package” (release date Nov 8, 2011) then download and install the package.
  3. The JDK will be installed into a different location then previous. This will result in IDEs (such as Eclipse) being unable to locate source code and java docs.
  4. At the time of writing the JDK ended up here:
    /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home
  5. Open up Eclipse preferences and go to Java > Installed JREs page
  6. Rather than use the “JVM Contents (MacOS X Default) we will need to use the JDK location
  7. At the time of writing Search is not aware of the new JDK location; we we will need to click on the Add button
  8. From the Add JRE wizard choose “MacOS X VM” for the JRE Type
  9. For the JRE Definition Page we need to fill in the following:
    JRE Home: /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home
  10. The other fields will now auto fill, with the default JRE name being “Home”. You can quickly correct this to something more meaningful such as:
    JRE name: System JDK
  11. Finish the wizard and return to the Installed JREs page
  12. Choose “System JDK” from the list
  13. You can now develop normally with:

沒有留言:

張貼留言

留個話吧:)