Open 5force opened 3 years ago
apparently, we can do it using Gradle https://docs.gradle.org/current/samples/sample_java_modules_multi_project.html
with Gradle and badass-jlink-plugin I have maked self-contained installer, but for now it's impossible using Maven and jpackage tool
Would be nice to see this as part of any work to resurrect OSGi support (#983). Keeping the library JDK8 compatible for now should be of concern as well IMHO.
We are looking to migrate from JDK 11 to JDK 17, and this is a major blocker in our applications preventing the migration to java 9 modules. Can someone please look into this?
@tlf30 would you like to contribute with a PR?
https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_modular
maybe @maciejwalkowiak can guide you during the process, I'm not familiar with the Java platform module system yet
I have this issue on my todo list, but I will also need some time to dig into it as I haven't worked with JPMS yet. @tlf30 you're welcome to create a PR.
@maciejwalkowiak unfortunately the module system is fairly new to me as well. I have only been learning it these last couple weeks as my company pushes to move from jdk 11 to jdk 17. Our biggest motivator to use modular applications was jfx 16 requiring it, and we are heavily dependent on javafx.
I'm afraid that if I was to prepare a PR that i would overlook something important. I am already fighting that in my own applications.
The Java Platform Module System (JPMS) was released in 2017 as a core feature of Java 9.
It would be great if at least an Automatic-Module-Name
could be added to the META-INF/MANIFEST.MF
file of the Sentry's JAR files until the library is fully modularized.
Is this the reason why Sentry does not work if run from a build created with the org.beryx.jlink
plugin?
Is this the reason why Sentry does not work if run from a build created with the
org.beryx.jlink
plugin?
Very likely, yes. From https://github.com/beryx/badass-jlink-plugin:
Using this Gradle plugin you can create a custom runtime image of your modular application with minimal effort, even if it depends on automatic modules.
Currently, Sentry does not support JPMS modules and does not even provide an automatic module name.
We'll bump prio on this but I can't give an ETA on when we'll get to it.
Luckily I found a way to avoid the JPMS.
Luckily I found a way to avoid the JPMS.
Thanks for letting us know! 😉
Platform: java --version openjdk 15 2020-09-15 OpenJDK Runtime Environment Zulu15.27+17-CA (build 15+36) OpenJDK 64-Bit Server VM Zulu15.27+17-CA (build 15+36, mixed mode, sharing)
IDE:
Build system: Maven -> embedded
Platform installed with: Maven Central
The version of the SDK:
module-info.java of project module com.test { requires javafx.controls; requires java.net.http; requires org.controlsfx.controls; requires io.sentry; exports com.test; }
When I try to make self-contained installer by jpackage for my modular test project it ends with error: jdk.incubator.jpackage.internal.PackagerException: jlink failed with: Error: automatic module cannot be used with jlink: io.sentry from file:///C:/Users/....../sentry-1.7.30.jar Do you have any plans to make Sentry modular that includes module-info.class file?