简体   繁体   English

Java Applet错误

[英]Java applet error

I am doing a project on applets. 我正在做一个关于applet的项目。 I designed the applet using netbeans. 我使用netbeans设计了applet。 After building the project in netbeans, I took the directory "classes" and a .html file from the "build" directory and moved it to another new directory. 在netbeans中构建项目之后,我从“ build”目录中获取目录“ classes”和一个.html文件,并将其移至另一个新目录。 This .html file includes the applet. 此.html文件包含小程序。 The .html file displays the applet correctly, when it is viewed from my desktop. 从我的桌面查看该.html文件时,它可以正确显示该applet。

I uploaded the "classes" folder and the .html file to my free server (host4ufree.com) using FileZilla. 我使用FileZilla将“ classes”文件夹和.html文件上传到了我的免费服务器(host4ufree.com)。 If I try to view the webpage online, I get the following error instead of the applet getting displayed: 如果我尝试在线查看网页,则会收到以下错误,而不是显示小程序:

java.lang.ClassFormatError: Extra bytes at the end of class file java.lang.ClassFormatError:类文件末尾的额外字节

I am using JDk 1.6.0 update 18, and uploaded the file using FileZilla both ASCII and binary format manner. 我正在使用JDk 1.6.0更新18,并使用ASCII和二进制格式的FileZilla上传文件。 Yet, I am not able to solve the error problem. 但是,我无法解决错误问题。 Does anybody know the solution to this? 有人知道解决方案吗? Is there something wrong in the manner in which I'm trying to add the applet to my webpage? 我试图将小程序添加到网页中的方式有​​问题吗?

The question is quite unclear :S Anyway... 这个问题还不清楚:反正...

I uploaded the "classes" folder and the .html file to my free server (host4ufree.com) using FileZilla. 我使用FileZilla将“ classes”文件夹和.html文件上传到了我的免费服务器(host4ufree.com)。

If your applet contains more that one class I do not recommend upload the project classes folder itself but wrap your applet classes to jar file before delpoying it. 如果您的小程序包含一个以上的类,那么我不建议您上载项目类文件夹本身,而应先将小程序类包装到jar文件中,然后再进行分配


Report if that helped 报告是否有帮助

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

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