Skip to content

Include JavaFX jmods (and remove forceMerge javaFX)#11170

Merged
calixtus merged 56 commits into
mainfrom
koppor-patch-2
Apr 10, 2024
Merged

Include JavaFX jmods (and remove forceMerge javaFX)#11170
calixtus merged 56 commits into
mainfrom
koppor-patch-2

Conversation

@koppor

@koppor koppor commented Apr 9, 2024

Copy link
Copy Markdown
Member

Fixes https://github.com/JabRef/jabref-issue-melting-pot/issues/412

After this is done:

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr Siedlerchr changed the title Switch from temurin to adoptium Switch from temurin to Zulu Apr 9, 2024
@koppor

koppor commented Apr 9, 2024

Copy link
Copy Markdown
Member Author
Messages are not initialized before accessing key: Display help on command line options
2024-04-09 09:37:26 [JavaFX-Launcher] sun.util.logging.internal.LoggingProviderImpl$JULWrapper.log()
WARN: Unsupported JavaFX configuration: classes were loaded from 'module org.jabref.merged.module', isAutomatic: false, isOpen: true
Exception in thread "JavaFX-Launcher" java.lang.NoSuchMethodError: notifyThemeChanged
        at org.jabref.merged.module@5.14.33/com.sun.glass.ui.win.WinApplication.initIDs(Native Method)
# Java VM: OpenJDK 64-Bit Server VM Temurin-22+36 (22+36, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)

@Siedlerchr

Copy link
Copy Markdown
Member

@koppor

koppor commented Apr 9, 2024

Copy link
Copy Markdown
Member Author

Foojay Gradle Plugin seems to stick to Temurin:

# Java VM: OpenJDK 64-Bit Server VM Temurin-22+36 (22+36, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)

@koppor

koppor commented Apr 9, 2024

Copy link
Copy Markdown
Member Author

Also happens when using Zulu:

# JRE version: OpenJDK Runtime Environment Zulu22.28+93-CRaC-CA (22.0+36) (build 22+36)

@koppor

koppor commented Apr 9, 2024

Copy link
Copy Markdown
Member Author

Linux:

Loading library prism_es2 from resource failed: java.lang.UnsatisfiedLinkError: /home/koppor/.openjfx/cache/23-ea+12/amd64/libprism_es2.so: libXxf86vm.so.1: cannot open shared object file: No such file or directory
java.lang.UnsatisfiedLinkError: /home/koppor/.openjfx/cache/23-ea+12/amd64/libprism_es2.so: libXxf86vm.so.1: cannot open shared object file: No such file or directory
        at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)

Comment thread .github/workflows/deployment-jdk-ea.yml
@Siedlerchr

Copy link
Copy Markdown
Member

Oh finally after 10 hours?

@koppor

koppor commented Apr 10, 2024

Copy link
Copy Markdown
Member Author
Error: Modules org.jabref.merged.module and javafx.base export package javafx.beans.property to module com.dlsc.gemsfx

Comment thread build.gradle
// but it was removed in the newer releases.
// The pom.xml associated with such a non-modular artifact does not mention that the artifact depends on the removed code
// (because the artifact was published when this code was still available in the JDK).
forceMerge "javafx"

@Siedlerchr Siedlerchr Apr 10, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this will not work this is intended for our merged module so that javafx is part of the merge module and can therefore be found

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you could try to add gemsfx to the merged module declaration

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Based on the comments above, I was thinking, it could help.

Two versions of module javafx.graphics found in /Users/runner/work/***/***/build/jlinkbase/jlinkjars (javafx-graphics-20-mac.jar and javafx.graphics.jar)

@Siedlerchr Siedlerchr Apr 10, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sounds like the downloading of javafx is wrong because we load it over our plugin and this will clash

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

 /home/runner/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-base/20/d82ec648e48647e10125ff0e3dce70348a80ac18/javafx-base-20-linux.jar

@Siedlerchr Siedlerchr Apr 10, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is likely the main culprit:

jabref/build.gradle

Lines 104 to 107 in b140d8a

javafx {
version = "22"
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.web', 'javafx.swing' ]
}

https://github.com/openjfx/javafx-gradle-plugin

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

(I document more for myself than for others)

This is likely the main culprit:

No.

This points to JavaFX 22, not 22. The file included is /home/runner/.gradle/caches/modules-2/files-2.1/org.openjfx/javafx-base/20/d82ec648e48647e10125ff0e3dce70348a80ac18/javafx-base-20-linux.jar and thus is 20 (twenty) not 22 (twenty-two)

I replace version by sdk in the yaml workflow:

sed -i '/javafx {/{n;s#version = ".*"#sdk = "javafx/javafx-sdk-${{ matrix.javafx }}"#}' build.gradle

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I seee, but they are still duplicated on the classpath

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Only with the -20 or do you see other duplicates?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe beryx/badass-jlink-plugin#61 (comment) helps. Currently checking.

@koppor

koppor commented Apr 10, 2024

Copy link
Copy Markdown
Member Author

Both the sdk and the jmods are available at https://jdk.java.net/javafx23/. Unzip in javafx sub directory.

@koppor

koppor commented Apr 10, 2024

Copy link
Copy Markdown
Member Author

Result:

image

@Siedlerchr

Copy link
Copy Markdown
Member

pipeline still failing? /home/runner/work/jabref/jabref/build/jlinkbase/tmpjars/org.jabref.merged.module/module-info.java:1113: error: module not found: javafx.base

@Siedlerchr

Copy link
Copy Markdown
Member

sure you did a ./gradlew clean before locally?

@koppor

koppor commented Apr 10, 2024

Copy link
Copy Markdown
Member Author

No clean: BELLSOFT same error, Corretto: no error

Now, trying clean locally.

Comment thread build.gradle Outdated
@koppor

koppor commented Apr 10, 2024

Copy link
Copy Markdown
Member Author

With Amazon Corretto:

image

@koppor koppor marked this pull request as ready for review April 10, 2024 21:37
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 10, 2024
@koppor koppor changed the title Include JMODS (and switch from temurin/liberica to adopt) Include JavaFX jmods (and remove forceMerge javaFX) Apr 10, 2024
@github-actions

github-actions Bot commented Apr 10, 2024

Copy link
Copy Markdown
Contributor

The build for this PR is no longer available. Please visit https://builds.jabref.org/main/ for the latest build.

@calixtus calixtus added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit aa0fa84 Apr 10, 2024
@calixtus calixtus deleted the koppor-patch-2 branch April 10, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants