从 Eclipse 生成可执行文件

发布于 2024-10-09 06:42:37 字数 150 浏览 0 评论 0原文

我编写了一个程序来帮助我解决一些问题,但每次需要它时,我都会打开 Eclipse 并运行它。

是否可以创建一个可执行文件,这样我就不需要每次都打开 Eclipse? 我使用的命令基本上是 System.out.println() 和 Scanner 来读取我键入的内容。

I've made a program to help me out with some stuff, but every time I need it, I open Eclipse and Run it.

Is it possible to create an executable file so I won't need to open Eclipse every time?
The commands I use is basically System.out.println() and Scanner to read what I type.

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

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

发布评论

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

评论(4

静若繁花 2024-10-16 06:42:37

右键单击项目。
导出为可运行的 jar。

Right-click on project.
Export as runnable jar.

旧故 2024-10-16 06:42:37

文件 ->导出-> Java->可运行的 JAR 文件

您必须选择您希望它运行的主类。这将允许您双击 JAR,并让它运行该 main。

File -> Export -> Java -> Runnable JAR File

You'll have to choose the main class that you want it to run. This will allow you to double-click on the JAR, and have it run that main.

凑诗 2024-10-16 06:42:37

您可以文件>出口> JAR 文件 将项目导出为 jar 并输入 java 命令以在 Windows 批处理文件上运行该 jar。或者,您可以 File >出口>可运行的 JAR 文件

You can File > Export > JAR file to export your project as a jar and put the java command to run the jar on a windows batch file. Alternatively you can File > Export > Runnable JAR file

小情绪 2024-10-16 06:42:37

您可以创建一个可执行的 jar 文件(使用 eclipse,或者像“ant”或“maven”这样的构建工具),也可以创建一个“真正的”Windows 可执行文件(您也可以将其提供给客户/朋友)。

我经常使用 JSmooth ( http://jsmooth.sourceforge.net/ ) - 这构建了一个包装器您的 jar 文件,可以帮助用户下载和安装适当的 java 虚拟机版本。

也许可执行 jar (参见 Serplat 的答案)文件就是您所需要的:)

You can either create an executable jar file (using eclipse, or a build tool like "ant" or "maven") or you can also create a "real" Windows-executable file (which you can also give to customers/friends).

I am using JSmooth a lot ( http://jsmooth.sourceforge.net/ ) - this builds a wrapper around your jar-files and can help the user with downloading and installing an appropriate java virtual machine version.

Probably the executable jar (see answer of Serplat) file is what you need :)

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