Replies: 1 comment 1 reply
-
Right now, AFAIK jlink automatically includes the JDK path for modules that it's invoked from. RE: JavaFX builds, you should check out this project: https://github.com/wiverson/maven-jpackage-template That template uses Maven platform detection to automatically pick the correct set of JavaFX jmods. jpackage doesn't support builds across platforms - you have to use Linux to build Linux, Windows to build Windows, macOS to build macOS. This is going to get a bit more complicated going forward with JDK 17 as Linux ARM/macOS M1 builds make things more confusing. I assume in the near future it will be x64/Intel and ARM across Linux, macOS and Windows. Whee! ;) |
Beta Was this translation helpful? Give feedback.
-
Some OpenJDK vendors like Liberica or Zulu provide OpenJDK builds with bundled OpenJFX. This is useful if someone wants to build its app for OS arch that OpenJFX doesn't support itself (e.g. for x32 Windows systems).
To create native images in a cross-platform fashion one have to specify corresponding jmods source. From what I've learned from jpackage-template you extracted jmods from OpenJFX dist and keeping them with code in the same repo. I'm not sure, but it looks like this may result to error if someone will try to create native Linux image from Windows. In that case jlink will always pickup Java jmods from Windows version and OpenJFX jmods from target platform version.
Maven Toolchains is merely a provider to locate Java home directory based on some filter criteria. So one can use it to build for different platforms and against different JDK versions from the single machine. Here is an example how toolchains support is implemented in Moditect. It basically just searches jmods dir based on JDK path specified and includes it to module path. It would be really nice if JToolProvider supported similar option in addition to
modulePath
. Like, whenbaseJdk
is specified its jmod dir is added to the specified inmodulePath
value.In any case thank you very much for your work. JToolProvider may be small but also super flexible as it works like simple CLI wrapper.
Beta Was this translation helpful? Give feedback.
All reactions