Embedding Java applet in html5

nwnoga picture nwnoga · Dec 29, 2012 · Viewed 10.4k times · Source

I'm trying to embed a Java applet that I just made into an HTML 5 compliant page. I'm using the following tag to embed the .jar file:

<object type="application/x-java-applet" height="300" width="550">
      <param name="code" value="MainClassName" />
      <param name="archive" value="MyJarFileName.jar" />
      Applet failed to run.  No Java plug-in was found.
</object>

The java applet will try to run but stop with:

java.lang.reflect.InvocationTargetException

I'm having trouble finding what is the cause of this error. My .jar file will run fine on its own. The main class extends JApplet, which contains a frame, which contains a JPanel.

What is causing this error?

Answer