如何将java项目转换为.exe?
你好,
我使用 Eclipse 软件编写了一个 java 项目。现在我需要将该项目转换为 .exe 文件。我导出该项目并因此转换为 jar 文件。
当我双击它时,它显示“无法从‘路径’加载主类属性”。所以解压它并查看 MANIFEST。 MF,那里只有一个版本。
我还使用了JartoExe软件并转换为exe文件。它显示了一个类似于文件的命令提示符,但是当我单击它时,我只是看到该窗口的闪现。它没有打开。
请帮我把jar文件转换成exe文件!!
提前致谢!
Possible Duplicate:
How can I convert my java program to an .exe file ?
Hello,
I coded a java project using Eclipse software. Now i need to convert that project to .exe file. I export that project and hence converted to jar file.
when i double click on it, it shows "failed to load Main-class attribute from 'path'". So unzipped it and looked into the MANIFEST. mf, there it has only version.
I also used JartoExe software and converted to exe file. It shows a cmd prompt like file but when i click it, i am just getting a flash of that window. Its not opening.
Please help me to convert the jar to exe file!!
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
看看这篇文章:http://introcs.cs.princeton.edu/ 85application/jar/jar.html
你基本上必须在清单中定义要执行的内容,然后如果你想要在 Windows 下运行你的程序,你可以将 jar 类型关联到 java.exe 或创建一个 .bat 文件正确启动罐子。
Take a look at this article: http://introcs.cs.princeton.edu/85application/jar/jar.html
You basically have to define what gets executed in the manifest and then if you want to your program under windows, you can either associate the jar type to java.exe or create a .bat file that starts the jar appropriately.
导出到 jar 文件时,您需要提供主类名称,这是程序的入口点。执行此操作后,jar 中的清单文件将包含它的条目,这将允许您通过双击来运行它罐。
While exporting to jar file you need to provide the main class name, which is the entry point to your program.Once you do this, manifest file in jar will have entry for it and that will allow you to run it by double clicking on the jar.
当您选择 Export from eclipse 时,其中一个对话框会询问您主类是什么。如果您指定它,那么当您双击 jar 时,它将启动该应用程序。
When you choose Export from eclipse, one of the dialogs asks you what the main class is. If you specify it then when you double click on the jar it will launch the app.
使用JEXECreator 1.9.3,非常好。它为您提供了两种运行程序的选项:使用控制台或 GUI
Use JEXECreator 1.9.3, it is very good. It gives you two options to run your program: either using the console or the GUI
最简单的方法是使用 eclipse 插件“fat.jar”并将其添加到您的 eclipse 中
接下来,当您右键单击您的项目时,您将获得构建 fat jar 的选项。
安装 fat jar 后重新启动 eclipse..
哇...
很容易...
The easiest way to do so is to have a eclipse plugin "fat.jar" and add it to your eclipse
next you will get an option to build fat jar when you right click on your project.
Do restart of your eclipse after installing fat jar..
wow...
very easy...
http://www.ej-technologies.com/products/exe4j/overview.html
这个我用过一次,不错。但如果我没记错的话,免费版本有某种广告闪屏。
http://www.ej-technologies.com/products/exe4j/overview.html
I once use this, it's good. But the free version has some kind of ads flash screen, if I'm not wrong.