【发布时间】:2011-10-29 01:56:31
【问题描述】:
我有一个使用多个外部 jar 的 Java 小程序。在 Eclipse 中,项目运行良好。当它被导出并嵌入到 HTML 文件中运行时,我得到 22 个运行时异常,类似于..
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
mil/dcgs/mdf/webservice/ddms/ingest/CatalogIngestService
..各种类。当我打开导出的 jar 时,我看不到 .class 文件或来自外部 jar 的任何其他痕迹。
HTML
HTML 是:
<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
我的.classpath 如下所示。
<?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>
【问题讨论】:
-
<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> -
酷。很高兴你把它分类了。 :-) 我删除了评论并将其添加为答案。如果是解决方案,请将其标记为正确。