Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quark and Linux issues #384

Open
michaelgosling opened this issue Sep 17, 2019 · 40 comments
Open

Quark and Linux issues #384

michaelgosling opened this issue Sep 17, 2019 · 40 comments
Labels
bug Something isn't working

Comments

@michaelgosling
Copy link

[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.

@parkerlreed
Copy link

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.

@droidman
Copy link

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.

@aria0012
Copy link

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

@michaelgosling
Copy link
Author

@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.

@A6GibKm
Copy link

A6GibKm commented Sep 18, 2019

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

@droidman
Copy link

droidman commented Sep 19, 2019

@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.

@A6GibKm
Copy link

A6GibKm commented Sep 19, 2019

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

@parkerlreed
Copy link

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

@XorTroll XorTroll added the bug Something isn't working label Sep 19, 2019
@XorTroll XorTroll changed the title [Quark] Error: JavaFX runtime components are missing Quark and Linux issues Sep 19, 2019
@A6GibKm
Copy link

A6GibKm commented Sep 19, 2019

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:https://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
Copy link

A6GibKm commented Sep 19, 2019

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.

@michaelgosling
Copy link
Author

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.

@Ntemis
Copy link

Ntemis commented Sep 27, 2019

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

@florensie
Copy link

Same issues on windows with OpenJDK 8, 10 and 12

@michaelgosling
Copy link
Author

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.

@florensie
Copy link

Especially since Oracle JDK 8 sucks to download now.

@lookye lookye mentioned this issue Oct 21, 2019
@ghost
Copy link

ghost commented Oct 24, 2019

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!

@A6GibKm
Copy link

A6GibKm commented Oct 24, 2019

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.

@ghost
Copy link

ghost commented Oct 25, 2019

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.

@Wilaemus
Copy link

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
Copy link

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
Copy link

References:

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
Copy link

I hope this helps!

@michaelgosling
Copy link
Author

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

@danielgruethling
Copy link

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.

@genesisxyz
Copy link

genesisxyz commented Nov 12, 2019

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

@ElSaico
Copy link

ElSaico commented Nov 18, 2019

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

@rkmax
Copy link
Contributor

rkmax commented Nov 29, 2019

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

@A6GibKm
Copy link

A6GibKm commented Dec 31, 2019

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

Specs:

  • Fedora Silverblue 31
  • java-11-openjdk

@1h8me2
Copy link

1h8me2 commented Feb 6, 2020

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

@A6GibKm
Copy link

A6GibKm commented Feb 6, 2020

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.

@1h8me2
Copy link

1h8me2 commented Feb 6, 2020 via email

@A6GibKm
Copy link

A6GibKm commented Feb 6, 2020

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

@luk1505
Copy link

luk1505 commented Mar 17, 2020

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?

@A6GibKm
Copy link

A6GibKm commented Mar 17, 2020

@luk1505 what Quark version are you trying?

@luk1505
Copy link

luk1505 commented Mar 17, 2020

@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).

@Merrit
Copy link

Merrit commented Mar 18, 2020

I had the same issue today, also Manjaro KDE.

@luk1505
Copy link

luk1505 commented Mar 18, 2020

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.

@fidelix
Copy link

fidelix commented May 9, 2020

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

@truita
Copy link

truita commented Nov 8, 2020

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)

@iDVB
Copy link

iDVB commented Aug 21, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests