1

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?

deduper
  • 1,944
  • 9
  • 22
Hydrolien
  • 36
  • 4
  • I use "OpenJDK Runtime Environment AdoptOpenJDK (build 15+36)" version if that can change something – Hydrolien Oct 07 '20 at 16:31
  • *all the create personalised jre are the Windows one.*, how do you infer that? – Naman Oct 07 '20 at 17:10
  • „*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'*“ — Are you referring to [*the one answered by Alan Bateman*](https://stackoverflow.com/questions/47593409/create-java-runtime-image-on-one-platform-for-another-using-jlink)? – deduper Oct 08 '20 at 23:19
  • @Naman they have exactly the same size and a java.exe file. – Hydrolien Oct 09 '20 at 08:08
  • @deduper yes that's what I tried. – Hydrolien Oct 09 '20 at 08:08
  • 2
    It looks like you're using *pseudopaths* for the different JDK distributions' JMOD locations: `jmodsWindows`, `jmodsLinux` and `jmodsMac`. What you're showing us *could* be hiding the cause of your problem. You should replace those *pseudopaths* with real ones that more accurately represent the actual locations on your file system. If you're concerned about privacy, you could anonymize them by replacing your name, say, with your cat's name. – deduper Oct 09 '20 at 15:28
  • @deduper I tried with ``` jlink --module-path C:\Users\hydrolien\Formiko\jmodsLinux``` – Hydrolien Oct 10 '20 at 09:33
  • 1
    @deduper - Cats need their privacy too! – Stephen C Oct 10 '20 at 11:06

1 Answers1

0

@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 !

Hydrolien
  • 36
  • 4