Goldleaf icon indicating copy to clipboard operation
Goldleaf copied to clipboard

Quark and Linux issues

Open michaelgosling opened this issue 6 years ago • 40 comments
trafficstars

[Quark] Error: JavaFX runtime components are missing

Bug description

When attempting to run the jar with an OpenJDK version of java or a more recent version of Oracle Java the following error occurs: Error: JavaFX runtime components are missing, and are required to run this application

JavaFX is no longer bundled with JDK/JRE as of Java 11 and Jars are not intended to be ran alone, instead the convention is to use a launcher.

Your setup

  • Console firmware: 9.0.0

  • CFW with version: Atmosphere 0.9.4

  • Goldleaf version: 0.7.1

  • Goldtree version: Quark-Release1

Bug reproduction

  1. Install latest JRE/JDK
  2. Download Quark.jar
  3. Launch Quark.jar either by double clicking or running java -jar Quark.jar in terminal/cmd
  4. Fails to launch, if launched by terminal greeted with following: Error: JavaFX runtime components are missing, and are required to run this application

Additional information

Solution might be to provide a launcher that launches the jar with bundled javafx modules. Java8 is archived on Oracle's website so it's sort of a pain to install, building with a more recent JDK might be preferred.

michaelgosling avatar Sep 17 '19 22:09 michaelgosling

Same here. Java8 with OpenJFX almost works but the window is screwed up

image

Java 11 and 12 with OpenJFX error out with the missing.

parkerlreed avatar Sep 17 '19 23:09 parkerlreed

https://github.com/droidman/Goldleaf you can get it further with my hacks but it's not fully working on Linux yet. You can't select folders to share yet but you can still browse "/" and select individual files.

droidman avatar Sep 18 '19 01:09 droidman

It also fails to detect connection when you open quark with java -jar, old exe works just fine

aria0012 avatar Sep 18 '19 10:09 aria0012

@aria0012 I’m not sure that’s related to this issue. Make sure to open your own issue for other bugs. This is specifically about JavaFX.

michaelgosling avatar Sep 18 '19 13:09 michaelgosling

Solution should be to bundle JavaFX as other similar apps do.

A6GibKm avatar Sep 18 '19 16:09 A6GibKm

@A6GibKm JavaFX is bundled. @aria0012 That's unrelated and you need either a udev rule or run as root on linux.

Use Java SE 8 if you want quark to run on Linux for now.

droidman avatar Sep 19 '19 00:09 droidman

It is bundled? It does not work as soon as I remove openjfx from my machine.

A6GibKm avatar Sep 19 '19 01:09 A6GibKm

0.7.2 crashes even weirder

[parker@stealth Videos]$ java -jar Quark.jar 
Sep 19, 2019 4:17:02 PM javafx.fxml.FXMLLoader$ValueElement processValue
WARNING: Loading FXML document with JavaFX API of version 11.0.1 by JavaFX runtime of version 11
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
        at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/converters/PaintConverter
        at com.jfoenix.controls.JFXTextArea$StyleableProperties.<clinit>(JFXTextArea.java:221)
        at com.jfoenix.controls.JFXTextArea.<init>(JFXTextArea.java:145)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:166)
        at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:404)
        at java.base/java.lang.Class.newInstance(Class.java:590)
        at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1019)
        at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:754)
        at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552)
        at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
        at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435)
        at xorTroll.goldleaf.quark.ui.MainApplication.start(MainApplication.java:103)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.converters.PaintConverter
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 25 more

OpenJRE 12 with OpenJFX

parkerlreed avatar Sep 19 '19 20:09 parkerlreed

Same, it was working last time, now I get

Exception in thread "main" java.lang.UnsupportedClassVersionError: javafx/application/Application has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at xorTroll.goldleaf.quark.Main.main(Main.java:9)

with java-1.8.0-openjdk and with java-12-openjdk I get:

(java:7578): Gdk-CRITICAL **: 18:37:32.589: gdk_x11_display_set_window_scale: assertion 'GDK_IS_X11_DISPLAY (display)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f09510d256a, pid=7578, tid=7604
#
# JRE version: OpenJDK Runtime Environment (12.0.2+9) (build 12.0.2+9)
# Java VM: OpenJDK 64-Bit Server VM (12.0.2+9, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libX11.so.6+0x3156a]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /home/msandoval/.opt/Switch/core.7578)
#
# An error report file with more information is saved as:
# /home/msandoval/.opt/Switch/hs_err_pid7578.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
[1]    7578 abort (core dumped)  java -jar Quark.jar

If I disable openjfx the core is dumped in both cases.

A6GibKm avatar Sep 19 '19 21:09 A6GibKm

For some reason I had disabled a component of openjfx so ignore the logs above, I still think that JafaFX should be bundled as it is harder to get with newer java versions. The jar is working with java-1.8.0-openjdk in fedora 30. I still have to test if it connects with goldleaf 0.7.2.

A6GibKm avatar Sep 19 '19 22:09 A6GibKm

Just to add, @XorTroll the title you've set is slightly misleading. OpenJDK is not linux-specific, this issue occurs on MacOS as well. OpenJDK is a decision some of us make deliberately. "Install Oracle Java" is not an ideal solution, as you can imagine.

michaelgosling avatar Sep 22 '19 21:09 michaelgosling

Fails to launch on Ubuntu 18.04 too WARNING: Loading FXML document with JavaFX API of version 11.0.1 by JavaFX runtime of version 11 Exception in Application start method Exception in thread "main" java.lang.RuntimeException: Exception in Application start method at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.NoClassDefFoundError: com/sun/javafx/css/converters/PaintConverter at com.jfoenix.controls.JFXTextArea$StyleableProperties.(JFXTextArea.java:221) at com.jfoenix.controls.JFXTextArea.(JFXTextArea.java:145) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at java.base/java.lang.Class.newInstance(Class.java:584) at javafx.fxml.FXMLLoader$InstanceDeclarationElement.constructValue(FXMLLoader.java:1019) at javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:754) at javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2722) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2552) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2435) at xorTroll.goldleaf.quark.ui.MainApplication.start(MainApplication.java:103) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455) at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) at java.base/java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method) at com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277) ... 1 more Caused by: java.lang.ClassNotFoundException: com.sun.javafx.css.converters.PaintConverter at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 23 more

Ntemis avatar Sep 27 '19 09:09 Ntemis

Same issues on windows with OpenJDK 8, 10 and 12

florensie avatar Oct 15 '19 17:10 florensie

Yeah I’m not sure why this is being written off as a Linux issue. People use OpenJDK on every platform, and given this software is open source it shouldn’t rely on Oracles JDK.

michaelgosling avatar Oct 15 '19 19:10 michaelgosling

Especially since Oracle JDK 8 sucks to download now.

florensie avatar Oct 16 '19 07:10 florensie

My solution was compiling my own Quark.jar from master with openjdk12 and openjfx12. You can download it here for use at your own risk: https://pbb.lc/public/Quark.jar Good luck!

ghost avatar Oct 24 '19 22:10 ghost

Could you provide detailed info on how you did this? It would be also helpful to know whether this runs with oracle's, this could help the maintainers to compile Quark with openjdk12.

A6GibKm avatar Oct 24 '19 22:10 A6GibKm

Could you provide detailed info on how you did this? It would be also helpful to know whether this runs with oracle's, this could help the maintainers to compile Quark with openjdk12.

I just cloned the repo and ran build.sh in Quark/. I did not make any changes to the code.

ghost avatar Oct 25 '19 05:10 ghost

Finally found a work around on Ubuntu 18.04 that fixes the same "Error: JavaFX" issue.

Ended up manually installing Oracle JRE/JDK 8.0.221 and adding it to the 'update-alternatives' program for quick selection between Java versions.

Wilaemus avatar Oct 27 '19 00:10 Wilaemus

To follow along:

  1. First, Download the file: 'jdk-8u221-linux-x64.tar.gz' ...and, yes, for this link you'll need a free Oracle account.

Found at: https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8u211-later-5573849.html

  1. In [terminal], navigate to 'Downloads' directory- then run: tar zxf "jdk-8u221-linux-x64.tar.gz"

  2. We'll move the extracted folder to shared 'jvm' directory. Run: sudo mv jdk1.8.0_221/ /usr/lib/jvm/

  3. Next, manually add a record for "OracleJDK 8.0.221" into the [update-alternatives] program. Run: sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_221/bin/java 1082

  4. Get current Java version. This is so you know which version to switch back to when finished. Run: java --version

I see:

java version "13.0.1" 2019-10-15 Java(TM) SE Runtime Environment (build 13.0.1+9) Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)

  1. Switch java versions using: sudo update-alternatives --config java

You'll be greeted with something similar to (but easier to read):

There are 4 choices for the alternative java (providing /usr/bin/java).

Selection____Path__________________________Priority___Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-13-oracle/bin/java 1091 auto mode * 1 /usr/lib/jvm/java-13-oracle/bin/java 1091 manual mode 2 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode 3 /usr/lib/jvm/jdk1.8.0_221/bin/java 1082 manual mode

Press <enter> to keep the current choice[*], or type selection number:

For me, I entered [3] to change to "jdk1.8.0_221".

  1. Test the change: java --version

Which now shows:

java version "1.8.0_221" Java(TM) SE Runtime Environment (build 1.8.0_221-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)`

  1. Finally, go execute 'Quark.jar' (where ever you saved it). java -jar Quark.jar

That works for me.

Best of luck!!

Wilaemus avatar Oct 27 '19 00:10 Wilaemus

References:

  • Thomas Bratt's script response to: https://stackoverflow.com/questions/25729592/how-to-install-jdk-8-in-ubuntu-12-04-using-tar-gz-file#25731092

Note:

  • This can be used as an outline for the steps to manually install other versions of Java too (ex. OracleJRE-8.221). Code the records accordingly to the version you use.

  • After step 4, I found it's possible to use [galternatives] to select installed versions of Java.

https://askubuntu.com/questions/159575/how-do-i-make-java-default-to-a-manually-installed-jre-jdk#159585

However, I was not able to install alternative java versions from within [galternatives]. Selection only for me.

Wilaemus avatar Oct 27 '19 00:10 Wilaemus

I hope this helps!

Wilaemus avatar Oct 27 '19 00:10 Wilaemus

@Wilaemus that is a known workaround. Installing Oracle JDK/JRE is not an acceptable solution, however.

michaelgosling avatar Oct 27 '19 16:10 michaelgosling

Can confirm that building Quark from source works. I just needed maven on my path and run the build.sh. Tested this with jdk-11.0.4.11-openj9 and javafx-sdk-11.0.2.

danielgruethling avatar Oct 28 '19 14:10 danielgruethling

Tested on Ubuntu 19.10 and Goldleaf 0.7.3 on Nintendo Switch Firmware 6.2.0:

sudo apt install maven git clone https://github.com/XorTroll/Goldleaf.git cd Goldleaf/Quark chmod +x build.sh sh build.sh cd target sudo java -jar Quark.jar

I am using OpenJDK 11

genesisxyz avatar Nov 12 '19 19:11 genesisxyz

It seems that #428 fixed it (the ClassNotFoundException is caused by a breaking change in JavaFX 9), hence why building from master works.

ElSaico avatar Nov 18 '19 22:11 ElSaico

I have tested with the following on my system (Archlinux)

  • java-10-openjdk
  • java-11-openjdk
  • java-13-jdk
  • java-13-openjdk
  • java-8-jdk
  • java-8-openjdk/jre
  • java-9-jdk

only with java-8-jdk I was able to run and properly work on my system

rkmax avatar Nov 29 '19 22:11 rkmax

Oof. I am not able to build latest quark 0.3.0, anyone else with this issue?

Specs:

  • Fedora Silverblue 31
  • java-11-openjdk

A6GibKm avatar Dec 31 '19 18:12 A6GibKm

Here is the process to install run the latest Quark in Linux (Tested in Fedora using Quark 0.8)

  1. Download Quark
  2. Install the latest openjdk sudo dnf install java-latest-openjdk
  3. Change your default java runtime sudo alternatives --config java
  4. Select the latest java by typing the number (Mine was number 2)
  5. Run Quark by opening a terminal in the directory that quark is located java -jar Quark.jar

1h8me2 avatar Feb 06 '20 12:02 1h8me2

Here is the process to install run the latest Quark in Linux (Tested in Fedora using Quark 0.8)

1. Download Quark

2. Install the latest openjdk
   `sudo dnf install java-latest-openjdk`

3. Change your default java runtime
   `sudo alternatives --config java`

4. Select the latest java by typing the number (Mine was number 2)

5. Run Quark by opening a terminal in the directory that quark is located
   `java -jar Quark.jar`

Since fedora uses wayland by default you have to run it as GDK_BACKEND=x11 java -jar Quark.jar But for some reason, Quark 0.3 uses all my cpu, to the point where my machine freezes.

A6GibKm avatar Feb 06 '20 12:02 A6GibKm

Is there a reason you cannot run the latest 0.8?

Sent from ProtonMail Mobile

On Thu, Feb 6, 2020 at 7:50 AM, Maximiliano [email protected] wrote:

Here is the process to install run the latest Quark in Linux (Tested in Fedora using Quark 0.8)

  1. Download Quark

  2. Install the latest openjdk sudo dnf install java-latest-openjdk

  3. Change your default java runtime sudo alternatives --config java

  4. Select the latest java by typing the number (Mine was number 2)

  5. Run Quark by opening a terminal in the directory that quark is located java -jar Quark.jar

Since fedora is uses wayland by default you have to run it as GDK_BACKEND=x11 java -jar Quark.jar But for some reason, Quark 0.3 uses all my cpu, to the point where my machine freezes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

1h8me2 avatar Feb 06 '20 13:02 1h8me2

The latest is actually 0.3 (which corresponds to goldleaf 0.8). I can run 0.2 just fine.

A6GibKm avatar Feb 06 '20 13:02 A6GibKm

Same here. Java8 with OpenJFX almost works but the window is screwed up

image

Java 11 and 12 with OpenJFX error out with the missing.

I have exactly the same issue with broken GUI window on Manjaro with KDE. Cannot be resized nor maximized. Even after building Quark myself, following instruction from here: https://github.com/XorTroll/Goldleaf/blob/master/docs/QUARK_LINUX.md

@parkerlreed Have you managed to solve it somehow?

luk1505 avatar Mar 17 '20 12:03 luk1505

@luk1505 what Quark version are you trying?

A6GibKm avatar Mar 17 '20 13:03 A6GibKm

@A6GibKm from newest Goldleaf release 0.8 (30 Dec 2019). Quark version number is not specified there.

I also tried Quark from older release 0.7.3, but I'm getting JavaFX errors (mentioned in this thread earlier by other people).

luk1505 avatar Mar 17 '20 13:03 luk1505

I had the same issue today, also Manjaro KDE.

Merrit avatar Mar 18 '20 00:03 Merrit

It seems to be an issue with KDE specifically, or maybe Manjaro + KDE. I installed XFCE as second DE and Quark is working there fine, no issues. Also tested on latest Ubuntu with Gnome.

luk1505 avatar Mar 18 '20 07:03 luk1505

Can confirm, it' an issue that only happens in KDE. Needs to be fixed on Quark, not KDE though

fidelix avatar May 09 '20 10:05 fidelix

I think this issue should be closed since it already works under KDE. The only thing is to add a udev rule if you don't want to run it as root (this applies to all linux systems)

truita avatar Nov 08 '20 10:11 truita

Still happening for me with: Java 8 macOS 11.4 0.9 (+ Quark 0.4)

Any way to get this to work without compiling from source?

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

WARNING: Loading FXML document with JavaFX API of version 11.0.1 by JavaFX runtime of version 11
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method

iDVB avatar Aug 21 '21 00:08 iDVB