Mac users are still waiting for Oracle / Apple to produce a simple download for using Java SE 7 on Macs running OS X. Until they provide one, the only safe way to use the Java 7 JDK is to build it from source. Luckily, Oracle provides a good wiki page that documents the process (and Arun Gupta has a useful post that helped with some of the gaps).
Check the Prerequisites:
OS X 10.7, Xcode 4.1 (easiest, and possibly the only way to get this, is from the Mac App Store), and Java for Mac OS X 10.7 Update 1
or
OS X 10.6.8, Xcode 3.2.6 (download from Apple Developer Portal), and Java for Mac OS X 10.6 Update 6
Mercurial version control tool. I installed this easily with the use of the awesome Mac package installer Homebrew. Simply run: “brew install hg”. (I didn’t make a dime for that blatant Homebrew plug 😉 )
Simple Process:
- Follow the Oracle instructions to “Get the Code”
- Run the Build command (part of the command is hidden by the box on the screen and if you don’t look close you may miss when copying / pasting) 😉
For all practical purposes, that’s it. If you want to install JDK 7 in the “Apple recommended” location follow steps 3-5 on the Oracle wiki page.
Just for grins I’m pasting the output of my build command. Pretty nice for a “wimpy” Mac Book Air. 😉
>>>Finished making images @ Sat Dec 17 00:09:17 CST 2011 ... ######################################################################## ##### Leaving jdk for target(s) sanity all docs images ##### ######################################################################## ##### Build time 00:20:58 jdk for target(s) sanity all docs images ##### ######################################################################## ## Build times ########## Target all_product_build Start 2011-12-16 23:34:39 End 2011-12-17 00:09:17 00:02:45 corba 00:08:18 hotspot 00:00:52 jaxp 00:00:55 jaxws 00:20:58 jdk 00:00:49 langtools 00:34:38 TOTAL ######################### erik@eriks-mba ~/dev/sdks/macosx-port $ build/macosx-universal/j2sdk-image/1.7.0.jdk/Contents/Home/bin/java -version openjdk version "1.7.0-internal" OpenJDK Runtime Environment (build 1.7.0-internal-erik_2011_12_16_23_34-b00) OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
If you have any questions about these steps just leave a comment below or ping me on twitter (@erikweibust).
Thanks for sharing. To be honest i would expect the process to take longer 🙂
Strangely, the build ended up in
build/macosx-amd64
on my MacBook Pro running Lion 10.7.2
I don’t know if this is significant. The JRE passes the smoke test.