[英]Possibility to run desktop application in a machine that doesn't contain a JVM
I am going to create a Desktop application in Java. 我将用Java创建一个桌面应用程序。 I don't know whether user having JAVA VIRTUAL MACHINE or not.
我不知道用户是否具有JAVA VIRTUAL MACHINE。
My questions are: 我的问题是:
I want to know whether its possible to run Java application in a machine that doesn't contains JVM. 我想知道是否有可能在不包含JVM的计算机上运行Java应用程序。
If its possible, I want to know whether this case is possible, I will created a application say MyApps, I will to convert this as .exe file and if user clicks MyApps.exe it should run my Java application and install JVM and run in that machine. 如果可能,我想知道是否可能发生这种情况,我将创建一个名为MyApps的应用程序,将其转换为.exe文件,如果用户单击MyApps.exe,它将运行我的Java应用程序并安装JVM并在其中运行那台机器。
Use webstart, and to install java automatically, see the great comment of Andrew Thompson. 使用webstart并自动安装Java,请参阅Andrew Thompson的精彩评论。
This is not completely pointless as many system have some version of Java but may not have the version you need. 这并不是完全没有意义的,因为许多系统都有Java的某些版本,但可能没有您需要的版本。
Nope, you need a JVM to run the Java bytecode. 不,您需要一个JVM来运行Java字节码。 The only solution would be to transform the bytecode into a different executable format.
唯一的解决方案是将字节码转换为其他可执行格式。
Finally I got the solution for running my Java application without Java Virtual Machine, by bundling JRE in the exe file. 最终,我通过将exe文件绑定到JRE,获得了无需Java虚拟机即可运行Java应用程序的解决方案。 I did this by using the following link.
我通过使用以下链接来做到这一点。
It's really working awesome. 真的很棒。
JAVA without JVM using Launch4J 使用Launch4J的没有JVM的JAVA
If we maintain the Directory Path as given we can get .exe with JRE bundled that will run without JVM. 如果我们按照给定的方式维护目录路径,则可以获取捆绑有JRE的.exe,而无需使用JVM就可以运行它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.