//
you're reading...
Uncategorized

Installing Oracle Java 7 on Mac OS X

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

wpid32-media_1335797961153.png

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

wpid33-media_1335797991095.png

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

wpid34-media_1335798146137.png

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

Begin The Installation

wpid35-media_1335798193523.png

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

wpid36-media_1335798228623.png

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!

wpid37-media_1335798272474.png

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

wpid38-media_1335798367972.png

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

wpid39-media_1335799033384.png

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.

About these ads

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

… who I am

Hi there! Thanks for visiting - this is an archived blog of some of the content I've written; please visit my new (and updated!) blog at

ChadThompson.me

… what I’m tweeting

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: