如何使Java应用程序独立?

发布于 2024-08-31 00:03:08 字数 81 浏览 5 评论 0原文

我必须将 Java 应用程序刻录到 CD 上。此应用程序必须在之前未进行任何安装的情况下在每台 Windows PC 上运行(也不应安装 JRE)。

I have to burn a Java application on a CD. This application have to run on every Windows PC wihtout any installation (also JRE shouldn't be installed) before.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

箜明 2024-09-07 00:03:08

我想您也可以将 JRE 从程序文件夹复制到 CD 上。然后,添加批处理脚本以使用“本地”JRE 启动您的应用程序。这应该足够了,但我不知道这是否适用于所有版本的 Windows。

I guess you could copy the JRE from your programs folder onto the CD too. Then, add a batch script to use your "local" JRE to start your app. That should be enough, but I don't know if this works with all versions of windows.

苍白女子 2024-09-07 00:03:08

您必须将 jre 捆绑到磁盘上并创建启动脚本。
如果您对简单的批处理/shell 启动脚本不满意,您可以使用 JLauncher 之类的工具来创建“真正的”可执行文件。

You'd have to bundle jre on disk and create startup scripts.
If you are not satisfied with simple batch / shell startup scripts you can use something like JLauncher to create "real" executable.

叫思念不要吵 2024-09-07 00:03:08

JSmooth 可以通过捆绑 JRE 或提示安装 Java 来实现这一点,而且它免费。您还可以设置 JVM 的属性

JSmooth can do the trick with bundling JRE or prompting install Java, and it is free. You can also set properties for JVM

最美的太阳 2024-09-07 00:03:08

最简单的方法是在 CD 上包含解压的 Java 安装并使用它来运行应用程序。

据我所知,市场上仍然只有 2 个“Java 到 exe”编译器,其中一个 (Excelsior JET) 非常昂贵,另一个 (GCJ) 不适用于使用 AWT 或 Swing 的程序。

The easiest way would be to include an unpacked Java installation on the CD and use it to run the application.

There are AFAIK only 2 "Java to exe" compilers still on the market, one of which (Excelsior JET) is quite expensive, and the other (GCJ) doesn't work on Programs that use AWT or Swing.

剪不断理还乱 2024-09-07 00:03:08

只需将 jre 也刻录到 CD 上,然后在批处理脚本中启动应用程序,该脚本将 CLASSPATH 和 JAVA_HOME 变量设置为指向您的 jre。

Just burn a jre onto the cd as well and start your application inside a batch script, which sets the CLASSPATH and the JAVA_HOME variables pointing to your jre.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文