java 如何将可执行 JAR 文件打包成 EXE

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17176900/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-01 01:13:00  来源:igfitidea点击:

How to package executable JAR file into EXE

javadeploymentexewrapperexecutable

提问by Aman

I would like to deploy my final build as an EXE with an application Icon.

我想将我的最终版本部署为带有应用程序图标的 EXE。

What is the best way to do this? What is the common practice?

做这个的最好方式是什么?通常的做法是什么?

回答by Motiejus Osipovas

Launch4j is a cross-platform tool for wrapping Java applications distributed as jars in lightweight Windows native executables. The executable can be configured to search for a certain JRE version or use a bundled one, and it's possible to set runtime options, like the initial/max heap size. The wrapper also provides better user experience through an application icon, a native pre-JRE splash screen, a custom process name, and a Java download page in case the appropriate JRE cannot be found.

Launch4j 是一种跨平台工具,用于将作为 jar 分发的 Java 应用程序包装在轻量级 Windows 本机可执行文件中。可执行文件可以配置为搜索某个 JRE 版本或使用捆绑版本,并且可以设置运行时选项,例如初始/最大堆大小。包装器还通过应用程序图标、本机预 JRE 启动画面、自定义进程名称和 Java 下载页面提供更好的用户体验,以防找不到合适的 JRE。

http://launch4j.sourceforge.net/

http://launch4j.sourceforge.net/

回答by Georgia Sevescu

I use jar2exe on Windows. Is a simple wizard done in java where you are asked to input your jar the icon of the exe and a few more information. Here is the link jar2exe

我在 Windows 上使用 jar2exe。是一个用 java 完成的简单向导,要求您输入 jar、exe 的图标和更多信息。这是链接jar2exe