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:

&lt;key&gt;JVMCapabilities&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;CommandLine&lt;/string&gt;
  &lt;/array&gt;


and add it to include the missing values:

&lt;key&gt;JVMCapabilities&lt;/key&gt;
  &lt;array&gt;
    &lt;string&gt;CommandLine&lt;/string&gt;
    &lt;string&gt;JNI&lt;/string&gt;
    &lt;string&gt;BundledApp&lt;/string&gt;
  &lt;/array&gt;


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.