We do not need to install JDK1.6. I repeat my answer to a similar question .
edit the Info.plist file in your jdk, for example:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Info.plist
JVMCapabilities, :
<key>JVMCapabilities</key>
<array>
<string>CommandLine</string>
<string>JNI</string>
<string>BundledApp</string>
<string>WebStart</string>
<string>Applets</string>
</array>