JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.58k stars 2.5k forks source link

Jabref does not run with gradle on Fedora and Nobara #11464

Open ThiloteE opened 3 months ago

ThiloteE commented 3 months ago

JabRef version

Latest development branch build (please note build date below) 2024-07-07 with commit b91e030349959c6b7998942bac75a289f3d8cd72

JabRef 5.14 JabRef 5.13 JabRef 5.12 JabRef 5.11

Operating system

GNU / Linux

Details on version and operating system

Fedora 40, KDE Plasma 6.1.1, Kernel 6.9.7-200, Wayland

Checked with the latest development build (copy version output from About dialog)

Steps to reproduce the behaviour

Description:

JabRef does not compile with gradle on Fedora and Nobara (Fedora based distribution).

How to reproduce:

  1. Get the JabRef code into your local workspace as described in the devdocs
  2. Open folder with JabRef code.
  3. Open the commandline
  4. Use following command: ./gradlew run

Notes:

JavaFXreproducer does compile.

Appendix

...

Log File ``` $ ./gradlew run > Configure project : Project : => 'org.jabref' Java module > Task :run Messages are not initialized before accessing key: Display help on command line options 2024-07-08 23:37:05 [main] org.jabref.Launcher.clearOldSearchIndices() INFO: Deleting out-of-date fulltext search index at /home/thilo/.local/share/jabref/lucene/95. 2024-07-08 23:37:05 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.addStylesheetToWatchlist() INFO: Watching css /home/thilo/Prog/Development/JabRef-JabRef_JabRef/JabRef/build/resources/main/org/jabref/gui/Base.css for live updates 2024-07-08 23:37:05 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings() INFO: Not updating theme because it hasn't changed 2024-07-08 23:37:05 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings() INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{file:/home/thilo/Prog/Development/JabRef-JabRef_JabRef/JabRef/build/resources/main/org/jabref/gui/Base.css} Exception in Application start method 2024-07-08 23:37:07 [main] org.jabref.Launcher.main() ERROR: Unexpected exception: java.lang.RuntimeException: Exception in Application start method at javafx.graphics@22.0.1/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:893) at javafx.graphics@22.0.1/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.awt.HeadlessException: No X11 DISPLAY variable was set, or no headful library support was found, but this program performed an operation which requires it, at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:166) at java.desktop/java.awt.Toolkit.getSystemSelection(Toolkit.java:1037) at org.jabref@100.0.0/org.jabref.gui.ClipBoardManager.(ClipBoardManager.java:42) at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:151) at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:86) at javafx.graphics@22.0.1/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839) at javafx.graphics@22.0.1/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483) at javafx.graphics@22.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at javafx.graphics@22.0.1/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455) at javafx.graphics@22.0.1/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at javafx.graphics@22.0.1/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at javafx.graphics@22.0.1/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$10(GtkApplication.java:264) ... 1 more BUILD SUCCESSFUL in 9s 9 actionable tasks: 1 executed, 8 up-to-date ```
Siedlerchr commented 3 months ago

Seems to be an awt issue with the clipboard manager

koppor commented 2 months ago

Now the "fun" part of Software Engineering starts... Systematic trial and error. To state which variant works and which doesn't. We already learned that the javafxreproducer starts.

Googling found following hints:

https://stackoverflow.com/a/75931990/873282 - it might really be that the gradle Toolchain picks up a non-wanted JDK. Are there any logs when running ./gradlew --info run? I mean: Is it output which JDK is used?

https://www.baeldung.com/linux/no-x11-display-error proposes to use ssh on Wayland. Really strange...

This one is also interesting 🙈 - https://unix.stackexchange.com/a/771546

koppor commented 2 months ago

I got it running:

image

sudo dnf install -y java-21-openjdk-devel.x86_64
koppor commented 2 months ago

I also added X11 support for Fedora39 - just to be sure: sudo dnf install -y kwin-x11 plasma-workspace-x11

koppor commented 2 months ago
declare -X DISPLAY=:0"
ThiloteE commented 2 months ago

sudo dnf install -y java-21-openjdk-devel.x86_64 did work.

ThiloteE commented 2 months ago

I would close the issue, once the apparent bug fix has been backported to the stable version of jdk 21, but I checked the jdk branches on github and there is no active jdk21 branch. Their latest tagged version has been stale for over a year, so what to do?

Siedlerchr commented 2 months ago

@ThiloteE They use different repos for backports

koppor commented 2 months ago

The thing is: I assumed that foojay would download the JDK automatically. But it does not for Fedora. WTF. --> Thus either "fix" foojay or fix our developer documentation!

Siedlerchr commented 1 month ago

What's the status here`

koppor commented 1 month ago

Reproduced using https://github.com/JabRef/jabref/tree/main/scripts/vms/fedora.

Workaround there: Explicit JDK installation.

Next step: