I have a Java applet which utilizes multiple external jars. In Eclipse the project runs fine. When it is exported and run embedded in a HTML file I get 22 run-time exceptions similar to..
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
mil/dcgs/mdf/webservice/ddms/ingest/CatalogIngestService
..with various classes. When I open the exported jar I see no .class files or any other traces from the external jar.
HTML
The HTML is:
<html>
<head>
<title>DIB Applet</title>
</head>
<body>
<applet
code="org.mitre.inception.Main.class"
archive="inception.jar"
WIDTH = "1020"
HEIGHT = "500">
Applet
</applet>
</body>
</html>
.classpath
My .classpath looks like the following.
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Users/myUserName/Desktop/jars/dcgs-util.jar"/>
<!-- more jars removed for space reasons as they look the same as above -->
<classpathentry kind="output" path="bin"/>
</classpath>
The
classpathmentionsdcgs-util.jar. That should probably be listed in thearchiveattribute of theappletelement. Perhaps something like:That would be assuming
inception.jarwas in the same directory as the HTML, and thatdcgs-util.jaris in thejarssub-directory of the dir. where the HTML is located.