简体   繁体   English

如何将Java与Applet项目制作成.exe文件

[英]How to make Java with Applet project into .exe file

How to make Java with Applet project into.exe file.如何将Java与Applet项目制作成.exe文件。 So it can run an any computer.所以它可以运行任何计算机。

It is not possible.这不可能。

It is not possible to create an exe that will run on any computer.不可能创建将在任何计算机上运行的 exe。 Period.时期。

It is possible to create an exe that will run on a Windows machine (I hesitate to say any Windows) but that exe won't run on Linux or Mac OSX... or any machine that is not a x86 or x86-64 machine (depending on how you built the exe).可以创建一个将在 Windows 机器上运行的 exe(我犹豫说任何Windows)但该 exe 不会在 Linux 或 Mac OSX 上运行......或任何不是 x86 或 x86-64 机器的机器(取决于您构建 exe 的方式)。

It is possible to run a Java application (from a JAR file) on any machine with Java preinstalled.可以在任何预装 Java 的机器上运行 Java 应用程序(来自 JAR 文件)。

It is possible to create an exe wrapper for a Java application (see How can I convert my Java program to an.exe file? ), but the exe won't that can run on any machine.可以为 Java 应用程序创建一个 exe 包装器(请参阅如何将我的 Java 程序转换为 .exe 文件? ),但该 exe 不能在任何机器上运行。 Like all exe files, it will only run on specific operating systems / hardware architectures.与所有 exe 文件一样,它只会在特定的操作系统/硬件架构上运行。 And converting to an exe like this may cause some aspects of Java not to work.并且像这样转换为exe可能会导致Java的某些方面无法正常工作。

I would recommend these alternatives:我会推荐这些替代品:

  • Distribute your application as a JAR file, and leave it up to the user to download and install a JRE separately.将您的应用程序作为 JAR 文件分发,并留给用户单独下载和安装 JRE。 (That is NOT hard to do.) (这并不难做到。)

  • Use an installer-builder (such as InstallAnywhere) to create installers for your application for the platforms you want to support.使用安装程序构建器(例如 InstallAnywhere)为您要支持的平台的应用程序创建安装程序。 Use the option for embedding a JRE in the installer.使用在安装程序中嵌入 JRE 的选项。


The other issue is that applet support is going to be removed entirely from Java pretty soon.另一个问题是小程序支持很快就会从 Java 中完全删除。 Indeed, it has already been de-supported in most modern browsers.事实上,它已经在大多数现代浏览器中被取消支持。 You should be looking to rewrite your UI code using AWT / Swing, JavaFX, HTML5 or something else.您应该使用 AWT / Swing、JavaFX、HTML5 或其他方式重写您的 UI 代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM