javasecurityappletcross-compilingsigned-applet

The Signed Applet on Java 6


My Java signed applet which is signed by Netbeans works well on Java's which is version 7. But on version 6 it does not work. How can I solve this problem.Is Java version 6 does not allow this? This is HTML code:

<html>
<head>

</head>
<body>
<applet archive="mi.jar" code="Mi.class" witdh="500" height="500">MY APLET</applet>
</body>
</html>

Solution

  • Java compiler javac has an option to compile the code to generate compatible bytecode for other platform versions by specifying -target option. Consult the cross-platform option in Oracle docs for Cross-Compilation Options. If he code compiles with this option then you could run both platform if not then you have to rewrite the Java 7 code to be compilable for the Java 6 platform.

    In the Netbeans IDE there should be a project settings where you could change either JDK or language level.