Oracle announced the official release of the JDK for Java SE 7 Update 4 on Mac OS X (Lion), as of 2012-04-26. No more need for the tricks discussed on this page.
Installation is simple per these instructions:
- Download from the usual place on the Oracle web site.
- Mount the DMG.
- Run the installer.
This release has a few limitations, most notably the lack of support for Web Start and the Java Plugin for web browsers. That support is expected later this year.
After installing, read the JDK for Mac ReadMe. Most importantly, if you want Java 7 to be the default, drag it to the top of the list in the Java Preferences app found in your Utilities folder.
Mac OS X easily supports multiple JVMs simultaneously. Each is now found here:
/Library/Java/JavaVirtualMachines
This geek gets a thrill seeing Mac OS X listed as a "Certified System Configuration".
By the way, Apple provides a mailing list for developers’ technical issues related to Java on OS X.