Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/main/java/dev/jbang/dependencies/ModularClassPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

public class ModularClassPath {
static final String JAVAFX_PREFIX = "javafx";
// Required by `javafx.web`; removed from the JDK in 26 and now shipped as
// `org.openjfx:jdk-jsobject`.
static final String JDK_JSOBJECT_MODULE = "jdk.jsobject";

private final List<ArtifactInfo> artifacts;

Expand Down Expand Up @@ -94,8 +97,15 @@ public List<String> getAutoDectectedModuleArguments(@NonNull Jdk jdk) {
resolvePathsResult.getPathElements().forEach((key, value) -> pathElements.put(key.getPath(), value));

pathElements.forEach((k, v) -> {
if (v != null && v.name() != null && v.name().startsWith(JAVAFX_PREFIX)) {
// only JavaFX jars are required in the module-path
if (v != null && v.name() != null
&& (v.name().startsWith(JAVAFX_PREFIX) || v.name().equals(JDK_JSOBJECT_MODULE))) {
// JavaFX jars belong on the module-path. So does `jdk.jsobject`, which is
// required by `javafx.web`: until JDK 25 it was part of the JDK, but JDK 26
// removed it and openjfx now ships it as the separate
// `org.openjfx:jdk-jsobject`
// artifact. Left on the class-path the boot layer cannot find it and fails with
// `Module jdk.jsobject not found, required by javafx.web`.
// See https://github.com/jbangdev/jbang/issues/559
modulePaths.add(k);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other fix could be to check if name is javafx.web and then additionally add jdk.jsobject to the module path. No need for self-crafted dependency inference.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — switched to special-casing jdk.jsobject, dropped the dependency inference (a2ef177).

Claude checked the module-info of every org.openjfx JavaFX artifact (v20→v26): jdk.jsobject is the only non-javafx.*, separately-shipped module any JavaFX module requires (and only javafx.web requires it). Everything else they pull in (java.*, jdk.jfr, jdk.xml.dom) is bundled in the JDK. That also explains the JDK 25→26 regression: jdk.jsobject used to live in the JDK and was removed in 26, so openjfx now ships it as org.openjfx:jdk-jsobject. Hard-coding the one module is enough.

} else {
// classpathElements.add(k);
Expand Down
Loading