I've instaled the Java for Developer package provided from Apple for 10.7 and java apps are running fine
but eclipse cannot find the JDK root path and I cant either.
Anybody any ideas?
Type terminal in the search bar and open it by clicking on the icon in the search results. 3. Once in the command line, run the command: java -version . The output should display the Java version installed on your MacOS.
How do I know if I have Java installed on my Mac? Mac OS X 10.6 and below: Apple's Java comes pre-installed with your Mac OS. Mac OS X 10.7 (Lion) and above: Java is not pre-installed with Mac OS X versions 10.7 and above. To get the latest Java from Oracle, you will need Mac OS X 10.7.
Mac OS X Lion (version 10.7; marketed as OS X Lion) is the eighth major release of Mac OS X, Apple's desktop and server operating system for Macintosh computers.
You can download the 10.7 Lion JDK from http://connect.apple.com.
Sign in and click the java
section on the right.
The jdk is installed into a different location then previous. This will result in IDEs (such as Eclipse) being unable to locate source code and javadocs.
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:
The other fields will now auto fill, with the default JRE name being "Home". You can quickly correct this to something more meaningful:
Finish the wizard and return to the Installed JREs page
Choose "System JDK" from the list
You can now develop normally with:
On newer versions of OS X you should find ALL JREs (and JDKs) under
/Library/Java/JavaVirtualMachines/
/System/Library/Java/JavaVirtualMachines/
the old path
/System/Library/Frameworks/JavaVM.framework/
has been deprecated.
Here is the official deprecation note:
http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/NewandNoteworthy/NewandNoteworthy.html#//apple_ref/doc/uid/TP40010380-CH4-SW1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With