如何在java中将jar文件转换为exe文件,以便我可以直接从桌面启动我的应用程序。 [英] How to convert jar file to exe file in java so that I can directly launch my application from desktop.

查看:195
本文介绍了如何在java中将jar文件转换为exe文件,以便我可以直接从桌面启动我的应用程序。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是客户端服务器应用程序,我应该在客户端属性文件中设置服务器端的ipaddress

My application is client server application where I should set the ipaddress of server side in client side properties file

推荐答案

你不能转换它。这不是Java的工作原理。



本质上,JAR是一组压缩的Java类文件。 Java类代码与Windows上使用的PE(可移植可执行代码)代码无关。 Java编译代码是字节码,它仅在JVM上运行,而EXE基于CPU指令集。 (在Microsoft Systems上,PE文件也可以针对CLR系统,它也基于类似于Java字节码,CIL代码的东西,但CIL也与JVM无关,它在CLR上运行,所以你可以忘记这个事实。 )JVM有自己的API,在本机运行时系统中没有大量资源。



参见:

https://en.wikipedia.org/wiki/Bytecode [ ^ ],

https ://en.wikipedia.org/wiki/Java_virtual_machine [ ^ ],

https://en.wikipedia.org/wiki/Java_ %28programming_language%29 [ ^ ](是的,也读它,不要以为你了解Java是什么,你真的不知道),

< a href =https://en.wikipedia.org/wiki/JAR_%28file_format%29> https://en.wikipedia.org/wiki/JAR_%28file_format%29 [ ^ ]。



总的来说,你对转换JAR的整个想法完全没用。如果你解释你的最终目标,也许你会得到更多帮助。



-SA
You cannot "convert" it. This is not how Java works.

Essentially, JAR is a zipped set of Java class files. And Java class code has nothing to do with PE (Portable Executable) code used on Windows. Java compiled code is bytecode which operates only on JVM, while EXE is based on CPU instruction set. (On Microsoft Systems, PE files can also target CLR system, which is also based on something similar to Java bytecode, CIL code, but CIL also has nothing to do with JVM, it operates on CLR, so you can just forget this fact.) JVM has its own API with big set of resources unavailable in the native runtime system.

See also:
https://en.wikipedia.org/wiki/Bytecode[^],
https://en.wikipedia.org/wiki/Java_virtual_machine[^],
https://en.wikipedia.org/wiki/Java_%28programming_language%29[^] (yes, read it too, don't assume that you understand what Java is, you really don't),
https://en.wikipedia.org/wiki/JAR_%28file_format%29[^].

Overall, your whole idea of "converting" JAR is totally useless. Perhaps you can get more help if you explain your ultimate goals.

—SA


I在你重新提出这个问题时给了你答案。将来请不要重新发布。
I gave you the answer in your repost of this question. In future please do not repost.


这篇关于如何在java中将jar文件转换为exe文件,以便我可以直接从桌面启动我的应用程序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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