简体   繁体   English

线程“ AWT-EventQueue-2”中的异常java.lang.NoClassDefFoundError

[英]Exception in thread “AWT-EventQueue-2” java.lang.NoClassDefFoundError

I get the error above in my Eclipse signed web applet. 我在Eclipse签名的Web小程序中收到上述错误。 I would appreciate any help.. 我将不胜感激任何帮助..

It states that my class is not found: 它指出找不到我的班级:

Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: com/dermalog/common/exception/DermalogException

Although I have images as proof that it is included in the build: 尽管我有图像证明它已包含在构建中:

Image1 Image2 图片1图片 2

How I added my jar files: 我如何添加我的jar文件:

  1. Made a "lib" folder 做了一个“ lib”文件夹
  2. Copied the jar files into the "lib" folder 将jar文件复制到“ lib”文件夹中
  3. clicked "Properties" on the project 在项目上单击“属性”
  4. Went to build path, libraries 去建立路径,图书馆
  5. Added the jar reference 添加了罐子参考

Adding a jar to project Java Build Path in an Eclipse project in most cases only means to add it to classpath used for compilation. 在大多数情况下,将jar添加到项目中的Eclipse项目中的Java Build Path仅意味着将其添加到用于编译的类路径中。 Items set on build path are also used to create classpath when running your application or applet from within Eclipse. 在Eclipse中运行应用程序或applet时,在构建路径上设置的项目也可用于创建类路径。

The build path however does not say anything about the classpath of your applet when it runs in a different context, eg on a webpage. 但是,当小程序在不同的上下文中(例如,在网页上)运行时,构建路径不会说明小程序的类路径。 There, one needs to make sure that classpath contains all jars needed to run the app. 在那里,需要确保classpath包含运行该应用程序所需的所有jar。

There are two simple ways to do this: 有两种简单的方法可以做到这一点:

  • Add a manifest file to your JAR and specify the classpath (required JARs) there. 将清单文件添加到您的JAR,然后在其中指定类路径(必需的JAR)。 Then, when deploying / copying your JAR to the location where it is being invoked, copy the dependency JARs as well. 然后,在将JAR部署/复制到被调用的位置时,也请复制依赖项JAR。
  • Include all classes from the JARs your applet depends on to your applet's JAR. 包括您的applet所依赖的JAR中的所有类,以及您applet的JAR中的所有类。 Eclipse's Export function allows this. Eclipse的Export函数可以做到这一点。

EDIT: Ok, I checked your jar file and found this: 编辑:好的,我检查了您的jar文件,发现了这一点:

  • MANIFEST.MF had no classpath definition. MANIFEST.MF没有类路径定义。 It should contain a line like: 它应该包含如下一行:

Class-path: dermalog.afis.drawing.compression.jar dermalog.afis.fingercode.jar dermalog.imaging.capturing.jar

  • The dependency jars should not be packaged in the dependant jar. 依赖罐不应该打包在依赖罐中。 Instead, they should be just placed in the same directory (or in a subdirectory - but then use that subdirectory in classpath as well). 相反,应该将它们放置在同一目录(或子目录中,然后再在类路径中使用该子目录)。

The page I linked above explains that. 我上面链接的页面对此进行了解释。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我在线程“ AWT-EventQueue-2” java.lang.NoClassDefFoundError中得到异常? - why i am getting Exception in thread “AWT-EventQueue-2” java.lang.NoClassDefFoundError? 线程“AWT-EventQueue-0”中的异常java.lang.NoClassDefFoundError - Exception in thread “AWT-EventQueue-0” java.lang.NoClassDefFoundError 线程AWT-EventQueue-2中的异常java.lang.NullPointerException - Exception in thread AWT-EventQueue-2 java.lang.NullPointerException 线程 awt-eventqueue-2 中的异常 java.lang.ArithmeticException / by Zero - Exception in thread awt-eventqueue-2 java.lang.ArithmeticException / by Zero 线程“ AWT-EventQueue-0”中的异常java.lang.NoClassDefFoundError:org / apache / commons / lang3 / Validate - Exception in thread “AWT-EventQueue-0” java.lang.NoClassDefFoundError: org/apache/commons/lang3/Validate Java 错误“线程异常”AWT-EventQueue-0“java.lang.NoClassDefFoundError: mslinks/ShellLink” - Java Error “Exception in thread ”AWT-EventQueue-0“ java.lang.NoClassDefFoundError: mslinks/ShellLink” 无法正确执行jar - 线程“AWT-EventQueue-0”中的异常java.lang.NoClassDefFoundError - Cannot excute jar correctly - Exception in thread “AWT-EventQueue-0” java.lang.NoClassDefFoundError 线程“ AWT-EventQueue-0”中的NetBeans异常java.lang.NoClassDefFoundError:DSA - NetBeans Exception in thread “AWT-EventQueue-0” java.lang.NoClassDefFoundError: DSA Ant 错误“线程异常”AWT-EventQueue-0“java.lang.NoClassDefFoundError:com/sun/jna/Library” - Ant error “Exception in thread ”AWT-EventQueue-0“ java.lang.NoClassDefFoundError: com/sun/jna/Library” 线程“ AWT-EventQueue-0”中的异常java.lang.NoClassDefFoundError:com / sun / image / codec / jpeg / JPEGCodec - Exception in thread “AWT-EventQueue-0” java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/JPEGCodec
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM