目前預設的安裝目錄是在
/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:
- Go to http://connect.apple.com and sign in with your Apple ID (developer account may be required – it’s free).
- 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.
- 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.
- At the time of writing the JDK ended up here:
/Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home - Open up Eclipse preferences and go to Java > Installed JREs page
- Rather than use the “JVM Contents (MacOS X Default) we will need to use the JDK location
- At the time of writing Search is not aware of the new JDK location; we we will need to click on the Add button
- From the Add JRE wizard choose “MacOS X VM” for the JRE Type
- 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 - 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 - Finish the wizard and return to the Installed JREs page
- Choose “System JDK” from the list
- You can now develop normally with:
沒有留言:
張貼留言
留個話吧:)