如何在eclipse中生成java项目的可执行文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18458682/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to generate executable of java project in eclipse
提问by Java Curious ?
I am trying to make an executable file of my Java Application but I don't know how to do that.
我正在尝试为我的 Java 应用程序制作一个可执行文件,但我不知道该怎么做。
I know how to generate an executable jar file, but I want to make an executable application.
我知道如何生成可执行的 jar 文件,但我想制作一个可执行的应用程序。
I'm using eclipse indigo to make the java application and to generate the jar file.
我正在使用 eclipse indigo 来制作 java 应用程序并生成 jar 文件。
How to make the executable?
如何制作可执行文件?
采纳答案by Moritz Petersen
回答by Scary Wombat
Many years ago Microsoft use to be able to generate exe from java code, but I do not believe that Eclipse has this feature.
很多年前微软使用能够从java代码生成exe,但我不相信Eclipse有这个功能。
回答by ankit
You can use JSMOOTH to wrap your jar file into .exe file. from wiki ->JSmooth is a tool for wrapping Java JAR files into Windows Portable Executable EXE files.
您可以使用 JSMOOTH 将您的 jar 文件包装成 .exe 文件。来自 wiki ->JSmooth 是一个用于将 Java JAR 文件包装成 Windows 可移植可执行 EXE 文件的工具。
For more info you can see this answer
有关更多信息,您可以查看此答案
回答by Gokul Nath KP
First export your project as a *.jar
in eclipse.
首先将您的项目导出为*.jar
Eclipse 中的一个。
Then, you can use JSmooth to make an *.exe
file.
然后,您可以使用 JSmooth 制作*.exe
文件。
Links:
链接:
http://www.vogella.com/articles/Eclipse/article.html
http://www.vogella.com/articles/Eclipse/article.html
回答by tom
The most common way to generate an EXE from a jar file is to use whats known as a "wrapper".
从 jar 文件生成 EXE 的最常见方法是使用所谓的“包装器”。
one of the more popular wrappers is http://www.jwrapper.com/which i belive mojang uses to wrap minecraft for windows.
比较流行的包装器之一是http://www.jwrapper.com/,我相信 mojang 用它来为 Windows 包装 minecraft。
However if you want to generate a purely native EXE that runs as a standalone you will need a native compiler for example: http://jnc.mtsystems.ch.
但是,如果您想生成作为独立运行的纯本机 EXE,您将需要本机编译器,例如:http: //jnc.mtsystems.ch。
At the end of the day java is designed to run on a VM double clicking on windows opens it up anyway, but if you really do want to make an EXE then the above methods should work.
归根结底,java 被设计为在 VM 上运行,双击 Windows 无论如何都会打开它,但是如果你真的想制作一个 EXE,那么上述方法应该可以工作。