[英]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.