Java Swing X11 execution error

Hi @tanker3278,

I tested your code under two different JDK’s, and got some interesting results. I am on Rock 6 just like you, but my display server is set to Plasma6 Wayland.

My default JDK is Adoptium’s Temurin 17, and running your code works without any issues. The interesting result occurs when I switch to the packaged JDK 21, I get the same error as you. I decided to try it with the java-17-openjdk package for comparison. Surprisingly it did not work, however, the error lead me to the solution.

You need to install the java-<version>-openjdk-gui package. After installing the gui package for both 17 and 21, I was successful in compiling and executing your code under both versions.

Please give it a try and let us know. Best regards

1 Like