创建一个针对Linux和Mac的基于Java 15的个性化JRE,适用于Windows。

huangapple go评论106阅读模式
英文:

Create a personalised JRE with Java 15 on Windows for Linux and Mac

问题

我找到了在Windows上创建个性化JRE的方法,可以在Windows上使用它。

我在这个网站上找到了一个类似的问题(https://stackoverflow.com/questions/47593409/create-java-runtime-image-on-one-platform-for-another-using-jlink),其中的答案是:“你只需要使用Linux jmods目录来创建一个个性化的Linux JRE。”

因此,我尝试使用AdoptOpenJDK(版本15+36)和以下命令进行操作:

jlink --module-path \jmodsWindows\ --add-modules java.desktop --output OUTWindows\java
jlink --module-path \jmodsLinux\ --add-modules java.desktop --output OUTLinux\java
jlink --module-path \jmodsMac\ --add-modules java.desktop --output OUTMac\java

但是,上述三个命令创建的个性化JRE都是Windows版本的。

我的命令有什么问题吗?JDK 15中是否有影响jlink工具创建自定义运行时映像的更改?

英文:

I have found a way to create a personalised JRE on Windows that I can use on Windows.

I found a similar question on this web site where the answer
was "you just have to use the Linux jmods directory to make a Linux personalised JRE."

So, using AdoptOpenJDK (build 15+36), I tried to do that with the following commands:

jlink --module-path \jmodsWindows\ --add-modules java.desktop --output OUTWindows\java
jlink --module-path \jmodsLinux\ --add-modules java.desktop --output OUTLinux\java
jlink --module-path \jmodsMac\ --add-modules java.desktop --output OUTMac\java

But the personalised JREs that all three above commands created are the Windows one.

Is there something wrong with my commands? Is there a change in JDK 15 that affects how the jlink tool creates custom runtime images?

答案1

得分: 0

Sure, here is the translation:

@deduper 我尝试过使用:

jlink --module-path C:\Users\hydrolien\Formiko\jmodsLinux --add-modules java.desktop --output OUTLinux\java

而且这是有效的!

这只是绝对路径或相对路径的问题。

非常感谢你的帮助!

英文:

@deduper I tried with :

jlink --module-path C:\Users\hydrolien\Formiko\jmodsLinux --add-modules java.desktop --output OUTLinux\java

And that's working !

That was just a problem of absolute or relative path.

thanks a lot for your help !

huangapple
  • 本文由 发表于 2020年10月8日 00:30:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/64248400.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定