我们如何制作Java可执行文件? [英] How can we make a Java executable file?

查看:68
本文介绍了我们如何制作Java可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是Java语言的学生.我想知道如何制作Java可执行(.exe)文件.请帮助我做到这一点.
在此先感谢
bye .....

Hi,
I am a student of the Java language. I want to know how can we make Java executable (.exe) file. Please help me to make this.
Thanks in advance
bye.....

推荐答案

Java不产生.exe文件,您将获得.class文件,或者将它们捆绑在一起. jar文件.

幸运的是,有一些工具可以将.jar文件转换为.exe,这里有一些指向执行此操作的各种工具的链接:

JSmooth [ ^ ]

JarToExe [ ^ ]

我还没有亲自尝试过这些方法,但我认为JSmooth看起来很酷.

希望对您有所帮助.
Java doesn''t produce .exe files, you''ll either get .class files or if you bundle those together a .jar file.

Luckily there are tools for converting a .jar file to a .exe, here''s some links to various tools that do this:

JSmooth[^]

JarToExe[^]

I haven''t personally tried any of these but I think the JSmooth looks cool.

Hope this helps.


这里的主要问题是:您这样做的目的是什么?"

您可能正在尝试在目标计算机上不需要Java运行时环境的预编译为本机代码可执行文件.这将为特定平台生成可执行文件.据我所知,只有两种可能: excelsior jet编译器 [ ^ ]和 ^ ].不久前,我在一个项目中进行了探索,并使用excelsior编译器进行了一些工作.不幸的是,该项目被无限期暂停".

您可能正在尝试对Java字节码进行包装,该包装对于用户而言更像是本机exe,或者简化了一些部署问题.这样做的可能性很多.

我建议您阅读此书 [
The big question here is: "What is your goal in doing this?"

You could be trying for a pre-compiled to native code executable that does not require a Java Runtime Environment on the target machine. This would produce an executable for a specific platform. As far as I know, there are only 2 possibilities available for this: the excelsior jet compiler[^] and the GNU compiler[^]. I was exploring this a while ago for a project and did a very little with the excelsior compiler. Unfortunately the project was "indefinitely suspended".

You could be trying for a wrapper around your Java byte code that appears more like a native exe to your users or simplifies some deployment issues. There are a lot of varied possibilities for this.

I would suggest that you read this[^]. It includes a lot of good explanation, the links I provided above, and links to many choices for the other approach.


这篇关于我们如何制作Java可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆