简体   繁体   English

除非从桌面打开小程序,否则抛出ClassNotFoundException

[英]ClassNotFoundException thrown unless applet opened from Desktop

I've been looking through the other questions regarding this issue but didn't find any that were similar to my situation. 我一直在浏览有关此问题的其他问题,但没有发现与我的情况类似的问题。 I have made an applet in Java and I noticed that I can only open the HTML(with ) involved from my desktop. 我已经用Java制作了一个applet,我注意到我只能从桌面打开涉及的HTML(with)。 If I attempt to open it from any other spot on the computer, it will throw the ClassNotFoundException despite the class being in the same folder as the html file. 如果我尝试从计算机上的任何其他位置打开它,则尽管该类与html文件位于同一文件夹中,它仍将引发ClassNotFoundException。

What would be causing this? 是什么原因造成的?

Thank You. 谢谢。

<HTML>
<HEAD>
<TITLE> .. </TITLE>
</HEAD>
<BODY>

<BODY BGCOLOR="#F0F0F0">
<p><center><img src = "Reunion2013.gif"></center></p>
<p><font size="5"><b><center>Murdock High School Alumni - It's Time to Party Together,        
<center></b></font></p> 

<table border="0">
<tr>
<td><b>Instructions</b><p></p></td>

</tr>

<tr><td>
<OL><LI>Fill in all information below. For State, enter the two-letter abbreviation.   
<LI>To restart your registration at any time, click the <i>Clear</i> button.
<LI>To submit your registration, click the Register button (A summary will display <br>
</br>
</td></tr>
</OL>
</table>
<p><center><APPLET CODE="ReunionRegistration.java" WIDTH=650 HEIGHT=250></center></p>
</APPLET>

</BODY>
</HTML>

尝试重新编写代码以通过以下方式访问小程序

<applet code="ReunionRegistration.class" WIDTH=650 HEIGHT=250 />

The code attribute expects a class , not a Java file. code属性需要一个 ,而不是Java文件。

APPLET CODE="ReunionRegistration.java"

should be 应该

APPLET CODE="ReunionRegistration.class"

Please see this reference: Java Applet Syntax . 请参阅此参考: Java Applet语法

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM