为什么在尝试运行Swing桌面应用程序时会出现HelpSetException - NoClassDefFoundError?

时间:2018-01-26 09:40:01

标签: java swing netbeans noclassdeffounderror

应用程序和帮助系统从netbeans IDE运行正常,但在部署时,帮助集上会返回异常。我检查了三个帮助罐jh.har,jhall.jar和jhbasic.jar是否在项目中>属性>图书馆>编译。我检查了从NetBeans创建的分发的内容,并验证了三个帮助文件是否在lib文件夹中。我已检查并验证Windows 8.1 CLASSPATH包含:

    CLASSPATH=C:\Program Files\Java\jdk1.8.0_72\bin; 
    D:\jh2.0\javahelp\lib; 
    D:\jh2.0\javahelp\bin     

这是来自运行的转储:

    C:\Program Files (x86)\NewDawn4>java -jar Newdawn.jar
    Error: A JNI error has occurred, please check your installation and try again
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/help/HelpSetException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.privateGetMethodRecursive(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: javax.help.HelpSetException
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 7 more 

深入研究这个问题并遵循其他人的建议,我仍然没有解决方案,无法看到我做错了什么。

1 个答案:

答案 0 :(得分:2)

尝试在manifest中设置classpath:

 Class-Path: lib/jh.jar lib/jhall.jar lib/jhbasic.jar