如何将源文件和类文件转换为小程序的 1 个可执行文件?

发布于 2024-12-27 09:56:45 字数 108 浏览 4 评论 0原文

我已经为一个朋友完成了一个项目——jave applet。要运行该项目,我只需单击 eclipse 中的“运行应用程序”即可。如何将我的项目转换为 1 个文件,以便我的朋友只需打开该文件即可启动小程序?

I have finished a project - jave applet - for a friend. To run the project I am simply clicking Run Application within eclipse. How do I convert my project into 1 file, such that my friend can simply open that one file and the applet will start?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

街角卖回忆 2025-01-03 09:56:45

只需将项目导出为 jar,可以直接通过 eclipse 或使用 Ant 之类的工具。

然后你的朋友只需将以下代码放入他们的 html 中......

<applet code="yourMainClass.class" archive="yourArchive.jar" codebase="yourCodebase/">

just export your project as a jar, either directly through eclipse or by using something like Ant.

Then your friend just puts the following code in their html...

<applet code="yourMainClass.class" archive="yourArchive.jar" codebase="yourCodebase/">
偏闹i 2025-01-03 09:56:45

重申一下,您可以使用导出向导在 Eclipse 中创建一个 Jar 文件。按 File 菜单,然后按 Export 子菜单,然后按照说明进行操作:

  • 选择 Jar them Next
  • 选择所需的文件和资源,创建 Jar 文件名,然后按 Next
  • 选择选项,然后下一步
  • 选择主类 - 我知道这对于桌面应用程序很重要,但我不确定小程序是否需要它。

To reiterate, you create a Jar file which is done in Eclipse using the Export wizard. Press the File menu then the Export sub-menu, then follow the instructions:

  • Select Jar them Next
  • Select the needed files and resources, create a Jar file name, then press Next
  • Select options, then Next
  • Select a main class -- I know this is important for a desktop application, but I'm not sure if it's needed for applets.
酒儿 2025-01-03 09:56:45

最简单的方法是使用 eclipse 导出选项。
转到文件->导出->Java(从列表)->Java可运行的 JAR 文件(如果没有,请使用 JAR 文件)-> 选择所需的项目 ->选择目标文件夹 ->结束。

在您选择的文件夹中,将有一个 .jar 文件。

The easiest way is to use eclipse export option.
Go to File->Export->Java (from list) -> Runnable JAR File (if you dont have it use JAR File instead)->Choose the project you want -> Choose Destination folder -> Finish.

In the folder you have choosen, will be a .jar file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文