简体   繁体   English

JApplet java.lang.NoClassDefFoundError:org / json / JSONException

[英]JApplet java.lang.NoClassDefFoundError: org/json/JSONException

I have this JApplet jar and tried to open it on the web. 我有这个JApplet jar,并尝试在网络上打开它。 But I keep getting this error 但我不断收到这个错误

java.lang.NoClassDefFoundError: org/json/JSONException java.lang.NoClassDefFoundError:org / json / JSONException

I've searched the answers here and tried them, but didn't work. 我在这里搜索并尝试了答案,但没有用。 Even if I already added the java-json.jar in my build path of the project. 即使我已经在项目的构建路径中添加了java-json.jar。

this is my html code for running my jar file on the web 这是我的html代码,用于在网络上运行我的jar文件

<applet archive="PDDS.jar" code="MainFrame.class" width="960" height="540">

I have two classes inside PDDS.jar, the JApplet class is the MainFrame.class, the other one is a class for connecting to the sqlite database. 我在PDDS.jar中有两个类,JApplet类是MainFrame.class,另一个是用于连接sqlite数据库的类。

Even if I already added the java-json.jar in my build path of the project. 即使我已经在项目的构建路径中添加了java-json.jar。

The build path of a project has nothing to do with the runtime class path, which is set in the applet element. 项目的构建路径与在applet元素中设置的运行时类路径无关。

So.. 所以..

<applet archive="PDDS.jar" code="MainFrame.class" width="960" height="540">

Should be more like.. 应该更像..

<applet archive="PDDS.jar java-json.jar" code="MainFrame.class" width="960" height="540">

Note also that the code attribute should best be the fully qualified name of the applet class, not the file name, so it would look like: 还要注意, code属性最好是applet类的完全限定名称, 而不是文件名,因此它看起来像:

<applet archive="PDDS.jar java-json.jar" code="MainFrame" width="960" height="540">

暂无
暂无

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

相关问题 Intellij Java:java.lang.NoClassDefFoundError:org/json/JSONException - Intellij Java: java.lang.NoClassDefFoundError: org/json/JSONException 处女座服务器抛出java.lang.NoClassDefFoundError:org / json / JSONException部署Java包时出错 - Virgo Server Throwing java.lang.NoClassDefFoundError: org/json/JSONException Error while deploying a Java package 运行 java 类时,Tomcat 服务器不会在 Eclipse 中启动。 引起:java.lang.NoClassDefFoundError:org/json/JSONException - Tomcat server won't start in Eclipse when running java class. Caused by: java.lang.NoClassDefFoundError: org/json/JSONException Java:NoClassDefFoundError:org / json / JSONException - Java: NoClassDefFoundError: org/json/JSONException jython java.lang.NoClassDefFoundError:java.lang.NoClassDefFoundError:org / json / simple / JSONObject - jython java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/json/simple/ JSONObject Java servlet java.lang.NoClassDefFoundError:org / json / JSONObject - Java servlet java.lang.NoClassDefFoundError: org/json/JSONObject 线程“main”中的异常java.lang.NoClassDefFoundError:org / json / JSONObject - Exception in thread “main” java.lang.NoClassDefFoundError: org/json/JSONObject java.lang.NoClassDefFoundError:org / hibernate / MappingException - java.lang.NoClassDefFoundError: org/hibernate/MappingException java.lang.NoClassDefFoundError:org / lwjgl / LWJGLException - java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException java.lang.NoClassDefFoundError:org / jnetpcap / Pcap - java.lang.NoClassDefFoundError: org/jnetpcap/Pcap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM