If you’ve been developing or using Java on Mac OS X, this weekend brought a new development: in the Java ecosystem, Mac OS X developers are now ‘first class’ citizens, having direct support for the Java Development Kit (JDK) from the Oracle Java team as of April 26, 2012 for Java 7 Update 4. At present, this release for Mac OS X is the “Developer” release with a consumer release expected in the fall. For more information about what this release entals, consult the press release for the update:
http://www.oracle.com/us/corporate/press/1603497
For now, let’s get to the moment OS X developers have been waiting for – an up to date JDK!
Log In to the Oracle Technology Network

In the past, Java for OS X was provided by Apple through the system Software Update functions – either for updating or installing new software. With this release, OS X developers will obtain Java system packages from the same repository as Windows and Linux developers through the Oracle Technology Network. (A shortcut is to http://oracle.com/java )
A big change for developers that are not part of the Oracle ecosystem – before downloading you will be prompted to create an account on the Oracle Technology Network, or to sign into an existing account if you’ve downloaded software from Oracle in the past, or even participated in the Oracle Technology Network forums.
Select The .dmg Package frrom the Software Downloads

The immediate thing that OS X developers will notice in the download list is the friendly “.dmg” file. You’ll also have to note that there is only 64-bit support for this development kit – so it appears that the bare minimum for OS support is 64-bit Leopard, though this install is being performed on 10.7 “Lion”. The experience on ealier operating systems may be different, and the installer should perform a check for supported operating system and hardware configurations prior to the installation.
Open the Downloaded DMG File – Install The Package

The installer for the JDK is an OS X Installer package – double click the package icon to begin the installation.
Begin The Installation

The install process is a familar one – a few introductory screens for a user to ensure that they are installing what they think they are installing, then a confmation step.
Confirm Installation

After the initial screns, you’re eventually prompted to Install the software. At this point the installer will ask you to enter Administrator credentials to the screen, as the installer will write to a System directory – sorry, no user-specific installs in this package.
Installation Succeeds!

The installation is a relatively short one – the progress bar will note the staus of the install before showing you the ‘success’ screen to close the installer. The linked “ReadMe” will be useful if you are also using a Java IDE with this release. Specific instructions for using this JDK with NetBeans, Eclipse and IntelliJ are included in the ReadMe file.
Choose The Default SDK In JavaPreferences.app

If your installation was successful, there will be a new JDK entry in the JavaPreferences.app (located in System Utilties) – Java SE 7 from the vendor “Oracle Corporation”. If you wish to make JDK 7 the default Java environment, drag the Java SE 7 entry to the top of the list. This will make JDK 7 the default for browsers and other applications using the Java as part of Mac OS X.
This won’t work for using JDK 7 for applications that require UNIX system settings, so you’ll also need to note the installation directory for setting JAVA_HOME properties.
Note the Location of JAVA_HOME

The Oracle package installs Java in a different system location than the Apple VM Framework – in this case, a new folder created by the installer. For running applications that require a JAVA_HOME variable, that value will be
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
Running the ‘java -version’ command will also load the new JVM prior to outputting versioning information, which can serve as a valuable troubleshooting aid should something go wrong during installation.
Discussion
No comments yet.