[英]How can I make an executable JAR file in Eclipse of an Applet?
I have been working on a small applet/game over the past week and someone recommended that I make it into a JAR file. 在过去的一周中,我一直在开发一个小型applet /游戏,有人建议我将其制作为JAR文件。 After looking into this more on Google I found a tutorial and started to follow it.
在Google上研究了更多内容之后,我找到了一个教程并开始关注它。 However, I soon realized that I needed to choose a class file that had a main method in it.
但是,我很快意识到我需要选择一个包含主要方法的类文件。 Applets do not use a main so I was wondering how I could still make it into a JAR file.
Applet不使用主程序,因此我想知道如何将其转换为JAR文件。 Thanks!
谢谢!
Applets do not use a main so I was wondering how I could still make it into a JAR file.
Applet不使用主程序,因此我想知道如何将其转换为JAR文件。
Yes they sure can. 是的,他们肯定可以。 In fact to have a good chance of being launched at all, applets need to be digitally signed, which can only be done with classes in a Jar.
实际上,要完全有机会启动小程序,必须对小程序进行数字签名,这只能通过Jar中的类来完成。
..However, I soon realized that I needed to choose a class file that had a main method in it
..但是,我很快意识到我需要选择一个包含主要方法的类文件
That sounds like a problem with your IDE (you don't yet know how to use it, as opposed to having it use you). 这听起来像是您的IDE的问题(相对于让您使用它,您还不知道如何使用它)。
BTW: BTW:
main(String[])
method (jar it and sign it) and launch it from a link on a web page using Java Web Start . main(String[])
方法(将其添加并签名),然后使用Java Web Start从网页上的链接启动它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.