I have an applet that depends on a number of jar files. The jars have been added to the classpath in eclipse. When I run the applet in eclipse, everything works OK. I then tried to put the applet on my website, and ran into the java.lang.NoClassDefFoundError related to classes in the external jar files.
I did:
jar -cvfm test.jar MANIFEST.MF *.class
with MANIFEST.M开发者_如何学JAVAF:
Class-Path: blah.jar blah2.jar
I then just put the two external jars in the same folder as the applet on my website and referenced the applet jar in the html. The relevant part of the jnlp file looks like:
<jar href="test.jar" main="true" />
<jar href="blah.jar" />
<jar href="blah2.jar" />
精彩评论