I have a severe bug with Lubuntu (and actually basically every other Linux distro except Ubuntu and Debian).
When opening a Java program with Swing GUI, the program is started but never shows a GUI. Otherwise the program works normally, plays sound and starts operating. The program icon bar thingy in the taskbar is shown as well.
There is no log output that would indicate any kind of problem (not even with the highest detail Swing logging enabled).
Is there any fix to this? Or can Java Swing just not be used on any Linux other than Ubuntu and Debian?
If it’s a bug, providing a link to the bug report on bug tracker is always useful so we can look up the details & get clear facts about it.
Further, as Lubuntu is actually a Ubuntu system, you already have stated it works, but you’re lacking specifics that allow us to provide any help anyway.
The only difference between Ubuntu Desktop/Server and Ubuntu flavors is the different packages included on a default install, excluding the release details. The link I provided uses the wording “each with their own choice of default applications and settings”, so if you know it works on a Ubuntu system, contrast the details between that release/packages and your not-working Lubuntu/Ubuntu system and you have the answer.
You need to provide specifics; Lubuntu has had 27 releases not including respins which would put that number much higher; and its the release details which are what you’d firstly contrast with your working Ubuntu system. The same actually mostly applies with Debian too; alas as they release on a different schedule that comparison is more complex.
You’ve tagged 24.04, but not said which that applies to, and if Ubuntu Desktop or Ubuntu Server was the same release etc.
the bug is actually so widespread that there are no further details required because you can take literally any Java Swing application (even a minimal 5 line code that just opens a blank window) and run it on any Linux and it will only work on Ubuntu and Debian and otherwise refuse to show the GUI.
I am using Lubuntu 24.04.1 LTS (which is already clear from posting in a Lubuntu forum and tagging this version), which I have downloaded from lubuntu.me/downloads.
I am running a GUI application so this applies to Lubuntu Desktop and Ubuntu Desktop, as a server OS is headless and would never run a GUI or even have a desktop; plus Lubuntu has no server version as far as I could find out.
There is no log that would indicate any error or missing packages, so I can’t go into any detail on where the issue might be. There is no way for me to find out a reason what is broken or even have a hint in which direction I could look.
I am basically hoping that anyone has experienced bugs like this before and knows what to do.
After tons of testing I have seen that the bug can’t be properly reproduced. It is bugged always on my specific application and it works sometimes on a minimal test program and sometimes not.
Most times the JFrame#setExtendedState(MAXIMIZED_BOTH) instruction causes entire failure to show any GUI at all. If only this instruction is left out, then a blank window is shown.
The entire rendering is totally bugged out then. Some elements are shown, some not, if I click on the window or move the mouse too much it blanks out and then I am left with a blank gray window.
So the huge problem is, that there is no minimal program that reliably reproduces the issue.
There is only the reliable fix to go with Ubuntu or Debian (or Windows).
Unfortunately JavaFX is by far not advanced enough to support everything I need. As of now I am forced to use Swing, and that won’t change for another few years.