How to launch apps that require Java on Mountain Lion with only Java 7 installed?

The dialog is shown because Oracle's Java has only partial 'JVMCapabilities' set and advertises itself as command-line-only capable.

As a superuser (use 'sudo' if editing in Terminal), you should edit /Library/Java/JavaVirtualMachines/jdk.1.7.[version-and-release].jdk/Contents/Info.plist and find the following key:

<key>JVMCapabilities</key>
  <array>
    <string>CommandLine</string>
  </array>

and add it to include the missing values:

<key>JVMCapabilities</key>
  <array>
    <string>CommandLine</string>
    <string>JNI</string>
    <string>BundledApp</string>
  </array>

After that, you have to either reboot, logout or killall Finder, what ever seems to work. (People have reported that restarting Finder was enough, but I had to log out.)

--
Source.