Hallo zusammen,
ich brauch mal wieder euren Rat.
Meine Umgebung:
- Ubuntu Mate (siehe Screenshot "Linux").
- IntelliJ IDEA
- OpenJDK 11.0.2 (siehe Screenshot "Java").
Mein Problem:
Ich will mit JavaFX eine Benutzeroberfläche darstellen. Auf meinem Windows Rechner hat das ganze ohne Problem funktioniert. Vor der neuinstallation von Ubuntu, hat es auch hier funktioniert. Jetzt leider nicht mehr.
Ich bekomme folgende Fehlermeldung beim compilieren des Projektes in IntelliJ:
Dazu hab ich bis jetzt folgendes als Lösung probiert:
- Ich habe dem ganzen Projekt sowie dem JavaFX-JDK volle Rechte gegeben
- Ich habe einmal alles was mit Java zu tun hat gelöscht und neu installiert mit
- Ich habe wieder alles gelöscht was mit Java zu tun hat, hab
hinzugefügt
Aktueller Stand:
- Ich habe die dependencies auskommentiert und von der JavaFX Seite javafx-sdk-11.0.2 heruntergeladen und in mein Projekt importiert. (Das hat mich dann wieder zu der oben stehenden Fehlermeldung gebracht). Installiert ist aktuel OpenJDK 11.
Bin auch gerne Bereit auf OpenJDK 8 zu gehen, brauch nicht zwigend die 11er Version.
Jetzt bin ich leider etwas radlos was ich noch tun könnte?
Da ihr mir letztens schon helfen konntet, wollt ich einfach nochmal nachfragen, vielleicht kennt jemand die Lösung und könnte mir helfen.
ich brauch mal wieder euren Rat.
Meine Umgebung:
- Ubuntu Mate (siehe Screenshot "Linux").
- IntelliJ IDEA
- OpenJDK 11.0.2 (siehe Screenshot "Java").
Mein Problem:
Ich will mit JavaFX eine Benutzeroberfläche darstellen. Auf meinem Windows Rechner hat das ganze ohne Problem funktioniert. Vor der neuinstallation von Ubuntu, hat es auch hier funktioniert. Jetzt leider nicht mehr.
Ich bekomme folgende Fehlermeldung beim compilieren des Projektes in IntelliJ:
/usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java --add-modules javafx.base,javafx.graphics --add-reads javafx.base=ALL-UNNAMED --add-reads javafx.graphics=ALL-UNNAMED -Djava.library.path=/home/janik/Downloads/javafx-sdk-11.0.2/lib -javaagent:/opt/idea-IC-191.6707.61/lib/idea_rt.jar=39353:/opt/idea-IC-191.6707.61/bin -Dfile.encoding=UTF-8 -classpath /home/janik/IdeaProjects/FireSubscriber/target/classes:/root/.m2/repository/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.0.2/org.eclipse.paho.client.mqttv3-1.0.2.jar:/root/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/root/.m2/repository/commons-io/commons-io/2.6/commons-io-2.6.jar:/root/.m2/repository/com/miglayout/miglayout/3.7.4/miglayout-3.7.4.jar:/root/.m2/repository/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/src.zip:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx-swt.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.web.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.base.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.fxml.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.media.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.swing.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.controls.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.graphics.jar -p /home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.base.jar:/home/janik/Downloads/javafx-sdk-11.0.2/lib/javafx.graphics.jar GUI.Main
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/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.IllegalAccessError: class com.sun.javafx.fxml.FXMLLoaderHelper (in unnamed module @0x2a0b1b6c) cannot access class com.sun.javafx.util.Utils (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.util to unnamed module @0x2a0b1b6c
at com.sun.javafx.fxml.FXMLLoaderHelper.<clinit>(FXMLLoaderHelper.java:38)
at javafx.fxml.FXMLLoader.<clinit>(FXMLLoader.java:2056)
at GUI.Main.start(Main.java:26)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
... 1 more
Exception running application GUI.Main
Process finished with exit code 1
Exception in Application start method
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.RuntimeException: Exception in Application start method
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
at javafx.graphics/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.IllegalAccessError: class com.sun.javafx.fxml.FXMLLoaderHelper (in unnamed module @0x2a0b1b6c) cannot access class com.sun.javafx.util.Utils (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.util to unnamed module @0x2a0b1b6c
at com.sun.javafx.fxml.FXMLLoaderHelper.<clinit>(FXMLLoaderHelper.java:38)
at javafx.fxml.FXMLLoader.<clinit>(FXMLLoader.java:2056)
at GUI.Main.start(Main.java:26)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
... 1 more
Exception running application GUI.Main
Process finished with exit code 1
Dazu hab ich bis jetzt folgendes als Lösung probiert:
- Ich habe dem ganzen Projekt sowie dem JavaFX-JDK volle Rechte gegeben
- Ich habe einmal alles was mit Java zu tun hat gelöscht und neu installiert mit
sudo apt install openjdk-8-jdk openjfx
- Ich habe wieder alles gelöscht was mit Java zu tun hat, hab
sudo apt install openjdk-11-jdk
installiert und über maven die depencies
Code:
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11</version>
</dependency>
Aktueller Stand:
- Ich habe die dependencies auskommentiert und von der JavaFX Seite javafx-sdk-11.0.2 heruntergeladen und in mein Projekt importiert. (Das hat mich dann wieder zu der oben stehenden Fehlermeldung gebracht). Installiert ist aktuel OpenJDK 11.
Bin auch gerne Bereit auf OpenJDK 8 zu gehen, brauch nicht zwigend die 11er Version.
Jetzt bin ich leider etwas radlos was ich noch tun könnte?
Da ihr mir letztens schon helfen konntet, wollt ich einfach nochmal nachfragen, vielleicht kennt jemand die Lösung und könnte mir helfen.