Open ppt000 opened 6 years ago
Same for me with Java11 or OpenJDK even with javafx installed. Always the same error message, even after "apt-get install openjfx".
After lots of trial-and-error I think I understood, that it simply doesn't work with any Java11 version. Going back to Java8 did the job (on Ubuntu):
sudo apt install openjdk-8-jdk
sudo update-java-alternatives -s java-1.8.0-openjdk-amd64
It doesn't work on Fedora 29:
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.201.b09-2.fc29.x86_64/bin/java -jar mqtt-spy-0.5.4-jar-with-dependencies.jar
Fehler: Hauptklasse pl.baczkowicz.mqttspy.Main konnte nicht gefunden oder geladen werden
Mebus
Yes, as I see Java 11 is not supported yet. Is there any plans to support Java 11 or should we move on?
I got it to sort of work with OpenJDK 11 and OpenJFX 11 with java --module-path /usr/share/openjfx/lib --add-modules javafx.base,javafx.controls,javafx.fxml -jar mqtt-spy-1.0.1-beta-b18-jar-with-dependencies.jar
, but you might need to add additional modules.
Can't cheat and setAccessible() anything you want with the new module in place, even without a security manager. So java --module-path /usr/share/openjfx/lib --add-modules javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.swing,javafx.web --add-exports javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.text=ALL-UNNAMED --add-exports javafx.graphics/com.sun.javafx.scene.text=ALL-UNNAMED --add-opens javafx.graphics/javafx.scene.text=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.text=ALL-UNNAMED -jar mqtt-spy-1.0.1-beta-b18-jar-with-dependencies.jar
is the closest I've gotten to getting it to work on Java 11.
Even then I encounter java.lang.ClassNotFoundException: com.sun.javafx.scene.control.skin.TabPaneSkin
(plus associated visual problems) and javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Premature end of file.
from within pl.baczkowicz.spy.ui.versions.VersionManager.loadVersions
.
Also, while connecting to servers seems to work, none of my subscription tabs get updated, even when I can tell from other logs that messages were passed on those topics.
@ppt000 JavaFX cannot really be included in the JAR (several discussions on the internet on why it is not a good idea). But, possibly, the right JRE can be bundled with the JAR to make it run, like I did on Windows here.
@olivm-fr OpenFX project now recommends building it in your jar. Older versions had problems with that, but it's been well and truly separated from the JRE (as have some remaining parts of JavaEE). Since Java 9, the JavaFX website recommends including it with your application: https://openjfx.io/openjfx-docs/#modular
when you compile a javafx application,you need javafx mods, but when you run a javafx application,you need javafx libs, this is the key to resolve your question.
I run it on Java 12, but it does't work well.
This issue can be fixed by adding the openjfx path and modules as arguments when running the javafx application, I already posted the solution on this link. Good luck Lotfi
Last commit was 2 years ago. Maybe it's time to leave...
I was not able to get it to run unter AdoptOpenJDK, even with the --module-path and --add-modules althoug i downloaded the jdk and copied the libs to the right folder and made sure that they where read correctly. So i tried out another client http://mqttfx.org/. Interestingly enough it comes with an installer like the branch of olivm-fr, https://github.com/olivm-fr/paho.mqtt-spy/releases/tag/1.0.1-proxy1, and like it, it installs an embedded java8 runtime.
I have the error:
and I have realised it is probably because JavaFX is not included anymore in Java11, which I run.
I don't know how to include JavaFX 11 so that it works, maybe it has to be recompiled? Can you include the necessary JavaFX classes in the jar?