I'm struggling to get my jar file working from a web browser. When I run the applet from Eclipse everything is OK, but from the browser I get a NoClassDefFoundError :
Exception: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/bouncycastle/openpgp/PGPException
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/bouncycastle/openpgp/PGPException
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3116)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
at java.lang.Thread.run(Thread.java:662)
The PGPException is in the org/bouncycastle/openpgp/ directory of the bcpg-jdk16-146.jar archive though... My JAR contains both libraries from bouncycastle and a my applet class. Here its architecture :
META-INF
-MANIFEST.MF
-CNSAPPLE.SF
-CNSAPPLE.RSA
lib
-bcprov-jdk16-146.jar
-bcpg-jdk16-146.jar
com
-CNSApplet.class
The manifest file defines the class path and the main class as it follows:
Class-Path: lib/bcpg-jdk16-146.jar lib/bcprov-jdk16-146.jar
Main-Class: com.CNSApplet
And the html code calling the applet:
<applet code="com.CNSApplet.class" width="800" height="300" archive="cnsapplet.jar">
Of course the html file is in the same directory of the cnsapplet jar file.
I've tried to make my jar with the sun method and this other one.