Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jigsaw support? provided as jmod & could be used for jlink to build os specific runtime #54

Open
chengenzhao opened this issue Nov 18, 2020 · 8 comments

Comments

@chengenzhao
Copy link

Hi:

Could this project provide jmod or jar in modular format
thus users could use jlink to build their own runtime for different os?

Thx

@tonsky
Copy link
Collaborator

tonsky commented Nov 18, 2020

I don’t have a good knowledge of best practices there. Can you describe in details how it should be organized and how it will be used?

@chengenzhao
Copy link
Author

chengenzhao commented Nov 18, 2020

Pretty much like JavaFX does now
They provide release version in jmod format: https://gluonhq.com/products/javafx/ , choose jmod to download jmods
then users could use jlink to build their own runtime based on these jmod

like this:
bin/jlink --module-path jmods --add-modules java.base,javafx.base,javafx.graphics,javafx.controls,java.logging,javafx.media --output macrt

similarly maybe with jmod format of this project we should use
bin/jlink --module-path jmods --add-modules java.base,com.jetbrain.skija --output macrt

then use this runtime to run the javafx or skija program

e.g.
macrt/bin/java -cp ".:libs/*" com.whitewoodcity.Main

In order to to that, we need the release in jmod which is java module format with native content
I believe skia is native content in this project

for more information:
https://stackoverflow.com/questions/44732915/why-did-java-9-introduce-the-jmod-file-format
http://openjdk.java.net/projects/jigsaw/

@tonsky
Copy link
Collaborator

tonsky commented Nov 18, 2020

So jmods are used only to package a self-sufficient JRE+app package, correct?

@chengenzhao
Copy link
Author

I think the best description for jmod is:
if there are native parts(os related) in jar, then it should be packaged as jmod rather than jar
jar should only contains class files and other os irrelevant resources
In this sense, netty-native should be packaged as jmods, and lwjgl etc. since they all include native parts in the jar

@tonsky
Copy link
Collaborator

tonsky commented Nov 19, 2020 via email

@chengenzhao
Copy link
Author

Right, usually we package different jmod into a customized runtime
and there is an open sourced tool for jlink command to package it
https://twitter.com/PatrikKarlstrom/status/1242884564416167938
Maven doesn't support jlink yet but there are plugins to manage them
https://start.gluon.io/

@tonsky
Copy link
Collaborator

tonsky commented Nov 19, 2020

Ok, seems like a good thing to do eventually. If you want to participate, I’d be happy to review a PR that implements that.

@Glavo
Copy link

Glavo commented Dec 28, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants