在ubuntu jlink上没有生成.bat脚本,只有bash脚本

发布于 2025-01-25 18:18:29 字数 199 浏览 0 评论 0原文

我正在尝试使用本指南来创建一个使用Laucher脚本的自定义JRE。我正在运行ubuntu 20.04,最后我只在bin文件夹中获得了bash脚本,但是jlink不应该同时创建.bat和bash脚本吗?

I am trying to create a custom JRE with laucher scripts using this guide. I am running Ubuntu 20.04, and at the end I got only the bash script in the bin folder, but wasn't it supposed for jlink to create both .bat and bash scripts?

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

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

发布评论

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

评论(2

会发光的星星闪亮亮i 2025-02-01 18:18:29

考虑到到目前为止的问题和评论...

要么您走传统方式,然后继续分发JAR文件。您的客户端可以在具有Java运行时的任何计算机上运行该应用程序(今天,这意味着他们安装了JDK,因为没有JRE)。

或者,您将应用程序包装包含JRE,因此客户不必关心所需的Java版本。为了使这更容易,已经创建了jlink和jpackage。看看 https://docs.oracle。 com/en/java/javase/17/jpackage/packaging-overview.html
只是要注意将必须在Windows计算机上创建Windows软件包,Linux计算机上的Linux软件包等。不支持交叉编译。

如果您喜欢WebStart(意味着您的应用程序的自动在线分发),请查看 https://openwebstart.com/

Considering the question and the comments so far...

Either you go the traditional way and continue to distribute jar files. Your client can run the application on any machine that has a Java Runtime (and today that means they install the JDK as there is no JRE any more).

Or you package your application to include the JRE so the client does not have to care which version of Java they need. To make this easier, jlink and jpackage have been created. Have a look at https://docs.oracle.com/en/java/javase/17/jpackage/packaging-overview.html
Just be aware Windows packages will have to be created on a Windows machine, Linux packages on a Linux machine etc. Cross-compiling is not supported.

If you prefer something like Webstart (which means automated online distribution of your application), take a look at https://openwebstart.com/

傲世九天 2025-02-01 18:18:29

您可以在Linux计算机上生成Windows软件包,反之亦然,请参见在另一个平台上创建Jlink 在另一个平台上创建Java Runtime Image

用于您需要目标平台的JDK,并指向其JMODS模块(jlink - module-path“ path_to_to_to_a_windows_jdk \ jmods”)。如果要在管道上进行操作,则可以使用MVN-JLINK MAVEN插件,该插件将下载所需的JDK。

You can generate a Windows package on a Linux machine and vice versa, see Create Java runtime image on one platform for another using Jlink

For that you need the JDK of the target platform and point to its jmods module (jlink --module-path "path_to_a_Windows_JDK\jmods"). If you want to do it on a pipeline you can use mvn-jlink maven plugin that would download the required JDK.

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