The problem is twofold really. For one thing Apple believes CS5 needs Java. Not much we can do about that I guess. However, the second part of the problem is that the JDK/JRE provided by Oracle does not properly specify its capabilities.
There is a file located in /Library/Java/JavaVirtualMachines/jdk.1.7.<…>/Contents/ called Info.plist . Copy this file into a location you may modify files in, say your downloads folder, then open it with your favorite texteditor. In the lower part of the file you will see the string JVMCapabilities. There you’ll see the lone “CommandLine” string as well. Replace the whole structure with the following:
<key>JVMCapabilities</key>
<array>
<string>JNI</string>
<string>BundledApp</string>
<string>WebStart</string>
<string>Applets</string>
<string>CommandLine</string>
</array>
After you did that save your copy of the Info.plist and the move it to its original location – you’ll need administrator privileges for that. Once that’s done restart your computer and enjoy not being nagged by the JRE6 dialog anymore.
The above link will download a plist that can be used with defaults import to set these abilitys