简体   繁体   English

如果使用小程序,如何使用Eclipse创建.jar文件?

[英]If I'm using applet how can I create a .jar file using Eclipse?

I am currently working on creating an artificial world and I have followed the following website http://www.ethics.ubc.ca/eame/eameweb/Simulators/JavaProject/TofC.html 我目前正在创造一个人造世界,并且关注了以下网站http://www.ethics.ubc.ca/eame/eameweb/Simulators/JavaProject/TofC.html

He used an applet to create it and have 9 classes in total. 他使用小程序来创建它,总共有9个类。

I have done edited the coding and it works perfectly fine in Eclipse but when I try to export a .jar file its just not working. 我已经完成了编码的编辑,它在Eclipse中工作得很好,但是当我尝试导出.jar文件时,它只是无法正常工作。

I have tried to export it as a "Jar File" and generate a Bug.jar and I extract the file and add, in the MANIFEST.MF file: 我试图将其导出为“ Jar文件”并生成一个Bug.jar,然后提取该文件并添加到MANIFEST.MF文件中:

Main-Class: Bugs.World 

Then when I double click the Bug.jar file, nothing happen. 然后,当我双击Bug.jar文件时,什么也没有发生。

When I try to export with "Runnable Jar File", I can't find my program under the Launch Configuration. 当我尝试使用“ Runnable Jar File”导出时,在“启动配置”下找不到我的程序。

Can anyone help me on this please? 有人可以帮我吗? Thanks! 谢谢!

Then when I double click the Bug.jar file, nothing happen. 然后,当我双击Bug.jar文件时,什么也没有发生。

That won't work for an applet. 这对于applet无效。 For more info., run it from the CLI as: 有关更多信息,请从CLI运行以下命令:

java -jar Bug.jar 

To launch an applet, it needs to be embedded in HTML or launched using Java Web Start (embedded or free floating) using a JNLP. 要启动小程序,需要将其嵌入HTML或使用JNLP使用Java Web Start (嵌入式或自由浮动) 启动

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

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