Issue
When running and displaying any Java program with a swing-based GUI on my BeagleBone Black Industrial, the windows are yellow and blank.
The window appears with the appropriate title. The minimize, maximize, and close buttons in the window work.
Running latest Debian:
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Running LXDE installed using sudo apt-get install lxde
.
Running OpenJDK11 installed using sudo apt install default-jdk
:
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-post-Debian-1deb10u1)
OpenJDK Server VM (build 11.0.11+9-post-Debian-1deb10u1, mixed mode)
The jar has been compiled for OpenJDK11. The program displays a window with a button that does nothing when pressed.
It runs fine on Windows. It also runs fine on a Raspberry Pi.
I am launching the java program using java -jar aa_SimpleWindowTest.jar
.
Does anyone have any idea why?
Solution
Found the solution here: https://stackoverflow.com/a/36235217/3743121
An example of it in action:
java -jar -Dsun.java2d.xrender=false aa_SimpleWindowTest.jar
Things I still don't understand: Why does it work on the RaspberryPi?
I know RaspberryPi forked the LXDE, and have made some changes since. I'd love to know if the changes made have to do with the Open JDK installation or the desktop environment.
Answered By - Hunter S Answer Checked By - Cary Denson (WPSolving Admin)