在小程序中未找到主要方法错误 [英] Main method not found error in an applet

查看:22
本文介绍了在小程序中未找到主要方法错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的学校,我使用 Notepad++ 编写小程序,我需要将它打包在一个 jar 中以便我可以签名.我正在尝试使用这样的批处理文件执行此操作:

At my school I am using Notepad++ to write an applet, and I need to package it in a jar so I can sign it. I am attempting to do this with a batch file like this:

CD C:\Users\name\Java\bin
javac className.java
jar cvfm className.jar Manifest.txt classFolder
java -jar className.jar
PAUSE

然后我得到一个未找到的主要方法异常.在调试或打开我的 jar 方面我无能为力,因为正如我之前所说,它在学校并且很多功能都被阻止了.如果需要,我可以提供更多详细信息,谢谢.

And then I get a main method not found exception. There is not much I can do in terms of debugging, or opening up my jar, because as I said before, it is at school and so much of the functionality is blocked. I can provide more details if needed, thanks.

推荐答案

Applet 没有 main 方法,因此您无法使用 java命令.

Applets don't have a main method, so you cannot run it in the conventional way with the java command.

要运行小程序,请创建一个包含小程序的 HTML 文件,然后运行 ​​appletviewer 或在 Web 浏览器中查看页面.

To run the applet, create an HTML file with the applet in it, and run appletviewer or view the page in a web browser.

这篇关于在小程序中未找到主要方法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆