The goal is to run the applet from the jar file.
The problem is that the applet seems to want to work only from the exploded jar file.
Samples on the Internet offer this applet tag:
<applet code="com.blabla.MainApplet" archive="applet.jar" width="600" height="600">
This is not even an attempt to search the jar file and does not execute:
Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/helloWord/com/blabbla/MainApplet.class at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 7 more
Setting the code base instead of the archive attribute in the jar file. It looks a little better. However, the JVM does not understand that it should open the jar file:
<applet code="com.blabla.MainApplet" codebase="applet.jar" width="600" height="600"> Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/helloWord/applet.jar/com/blabbla/MainApplet.class at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 7 more
How should an applet tag be formulated to run an applet class from inside a jar file?
source share