You are not logged in.

#1 2021-08-28 10:49:48

nx_frost
Member
From: Canada
Registered: 2021-08-28
Posts: 7

[SOLVED] All Java GUI applications fail to properly render graphics

Allow me to preface this post by stating that I have researched this issue in depth both on this forum and on the internet at large, and have thus far not had success in finding anything that was successful in resolving it. I will list my attempted resolutions at the bottom of the post.

Relevant configuration details:

$ uname -a
Linux violet 5.13.13-zen1-1-zen #1 ZEN SMP PREEMPT Thu, 26 Aug 2021 19:14:35 +0000 x86_64 GNU/Linux

$ pacman -Q nvidia-dkms
nvidia-dkms 470.63.01-1

$ pacman -Q xorg-server
xorg-server 1.20.13-2

$ pacman -Q xfdesktop  
xfdesktop 4.16.0-2

$ pacman -Q xfwm4
xfwm4 4.16.1-2

$ java --version
openjdk 11.0.12 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7)
OpenJDK 64-Bit Server VM (build 11.0.12+7, mixed mode)

$ archlinux-java status
Available Java environments:
  java-11-openjdk (default)

For my example I will use Ghidra 10.0.2 [github]

This is the result of launching Ghidra using Java 11:
Broken Java GUI

This behaviour is consistent across all Java GUI applications, there are no exceptions. It is completely unusable. There are no errors thrown by the JVM, as far as I can tell it should be displaying properly, but alas.

Attempted resolutions

In solving this issue, I have done the following:

  • Within /etc/profile.d/jre.sh set GTK LookAndFeel

    export JDK_JAVA_OPTIONS='-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
  • Within /etc/profile.d/jre.sh forced GTK version to any allowed value in conjunction with above options

    export JDK_JAVA_OPTIONS='-Djdk.gtk.version={2,2.2,3}'
  • Enabled OpenGL hardware acceleration

    export _JAVA_OPTIONS='-Dsun.java2d.opengl=true'

This issue is present regardless of JRE version (tested with jre8, jre11, jre16) and also regardless of window manager (tested with i3wm, metacity and xfwm4).

It is often mentioned that Java has issues pertaining to gray boxes. I may not have a gray box, but it is not dissimilar in the sense that it simply refuses to render. Other Java applications may render this same shade of "no-texture blurple" (#8080ff), or alternatively may render a transparent background, or one that steals the image from the window behind it.

Thank you in advance for your assistance and please do let me know what further information I can provide.

Last edited by nx_frost (2021-09-04 11:42:27)


Sic itur ad astra.

Offline

#2 2021-08-28 11:15:41

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] All Java GUI applications fail to properly render graphics

Does it work with ghidra from [community] repository [1] ?

$ pacman -Qo /etc/profile.d/jdk.sh
error: No package owns /etc/profile.d/jdk.sh
$ pkgfile /etc/profile.d/jdk.sh
$ 
$ pkgfile jdk.sh
$

That file doesn't appear to come from an official java package.

Please post output of

$ archlinux-java status
$ pacman -Qs java

Welcome to archlinux forums



[1] https://archlinux.org/packages/community/x86_64/ghidra/

Last edited by Lone_Wolf (2021-08-28 11:16:36)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2021-08-28 20:07:44

nx_frost
Member
From: Canada
Registered: 2021-08-28
Posts: 7

Re: [SOLVED] All Java GUI applications fail to properly render graphics

Thank you for your prompt reply.

I apologize, yesterday I wrote this post just before turning in for sleep. As a result, I erroneously believed the path was /etc/profile.d/jdk.sh however it is in fact /etc/profile.d/jre.sh which we can see is owned by the java-runtime-common package.

$ pacman -Qo /etc/profile.d/jre.sh
/etc/profile.d/jre.sh is owned by java-runtime-common 3-3

As requested, here are my installed Java packages:

$ pacman -Qs java
local/ca-certificates-utils 20210603-1
    Common CA certificates (utilities)
local/java-environment-common 3-3
    Common files for Java Development Kits
local/java-runtime-common 3-3
    Common files for Java Runtime Environments
local/java11-openjfx 11.0.10.u1-1
    Java OpenJFX 11 client application platform (open-source implementation of JavaFX)
local/jdk11-openjdk 11.0.12.u7-1
    OpenJDK Java 11 development kit
local/jre11-openjdk 11.0.12.u7-1
    OpenJDK Java 11 full runtime environment
local/jre11-openjdk-headless 11.0.12.u7-1
    OpenJDK Java 11 headless runtime environment
local/webkit2gtk 2.32.3-1
    Web content engine for GTK

I would like to further clarify that this issue exists whether I use the community version of Ghidra or not. In fact, it happens with any and all Java projects, including ones that I have compiled myself. Anything that uses non-headless Java is completely broken.

Thank you for your continued assistance, it is greatly appreciated. Regards.


Sic itur ad astra.

Offline

#4 2021-08-29 11:06:51

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] All Java GUI applications fail to properly render graphics

Outputs show no issues, I'm beginning to suspect a graphics issue.

First some more basic stuff :

Output of stat user/bin/java

You have tried several WMs , but did you try with setting LG3D using wmname ?
If not, please try it.


Does using stock linux or linux-lts kernel change things ?

lspci -k and xrandr --listproviders outputs would help to verify your hardware/graphics setup .

Last edited by Lone_Wolf (2021-08-29 11:07:28)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2021-08-31 20:44:41

nx_frost
Member
From: Canada
Registered: 2021-08-28
Posts: 7

Re: [SOLVED] All Java GUI applications fail to properly render graphics

I have indeed tried setting the window manager name using wmname, and renamed to LG3D both manually and by setting the variable in ~/.xinitrc, both of which did not appear to make any difference.

stat Java:

$ stat /usr/bin/java 
  File: /usr/bin/java -> /usr/lib/jvm/default-runtime/bin/java
  Size: 37        	Blocks: 0          IO Block: 4096   symbolic link
Device: 803h/2051d	Inode: 9708634     Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2021-08-27 21:29:51.121615713 -0600
Modify: 2020-05-16 03:30:33.000000000 -0600
Change: 2021-08-27 21:29:50.839614179 -0600
 Birth: 2021-08-27 21:29:50.839614179 -0600

Full output of lspci with kernel drivers flag:

$ lspci -k
00:00.0 Host bridge: Intel Corporation 8th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
	Subsystem: ASUSTeK Computer Inc. PRIME H310M-D
	Kernel driver in use: skl_uncore
	Kernel modules: ie31200_edac
00:01.0 PCI bridge: Intel Corporation 6th-10th Gen Core Processor PCIe Controller (x16) (rev 07)
	Kernel driver in use: pcieport
00:14.0 USB controller: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller
	Subsystem: ASUSTeK Computer Inc. Device 8694
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
00:16.0 Communication controller: Intel Corporation 200 Series PCH CSME HECI #1
	Subsystem: ASUSTeK Computer Inc. Device 8694
	Kernel driver in use: mei_me
	Kernel modules: mei_me
00:17.0 SATA controller: Intel Corporation 200 Series PCH SATA controller [AHCI mode]
	Subsystem: ASUSTeK Computer Inc. Device 8694
	Kernel driver in use: ahci
00:1b.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #17 (rev f0)
	Kernel driver in use: pcieport
00:1c.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #1 (rev f0)
	Kernel driver in use: pcieport
00:1c.2 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #3 (rev f0)
	Kernel driver in use: pcieport
00:1c.4 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #5 (rev f0)
	Kernel driver in use: pcieport
00:1c.6 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #7 (rev f0)
	Kernel driver in use: pcieport
00:1d.0 PCI bridge: Intel Corporation 200 Series PCH PCI Express Root Port #9 (rev f0)
	Kernel driver in use: pcieport
00:1f.0 ISA bridge: Intel Corporation Z370 Chipset LPC/eSPI Controller
	Subsystem: ASUSTeK Computer Inc. Device 8694
00:1f.2 Memory controller: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller
	Subsystem: ASUSTeK Computer Inc. Device 8694
00:1f.3 Audio device: Intel Corporation 200 Series PCH HD Audio
	Subsystem: ASUSTeK Computer Inc. Device 8723
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
00:1f.4 SMBus: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller
	Subsystem: ASUSTeK Computer Inc. Device 8694
	Kernel driver in use: i801_smbus
	Kernel modules: i2c_i801
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V
	Subsystem: ASUSTeK Computer Inc. Device 8672
	Kernel driver in use: e1000e
	Kernel modules: e1000e
01:00.0 VGA compatible controller: NVIDIA Corporation TU102 [GeForce RTX 2080 Ti Rev. A] (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 866a
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia
01:00.1 Audio device: NVIDIA Corporation TU102 High Definition Audio Controller (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 866a
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel
01:00.2 USB controller: NVIDIA Corporation TU102 USB 3.1 Host Controller (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 866a
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU102 USB Type-C UCSI Controller (rev a1)
	Subsystem: ASUSTeK Computer Inc. Device 866a
	Kernel driver in use: nvidia-gpu
	Kernel modules: i2c_nvidia_gpu
04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822BE 802.11a/b/g/n/ac WiFi adapter
	Subsystem: ASUSTeK Computer Inc. Device 8746
	Kernel driver in use: rtw_8822be
	Kernel modules: rtw88_8822be
05:00.0 USB controller: ASMedia Technology Inc. ASM2142 USB 3.1 Host Controller
	Subsystem: ASUSTeK Computer Inc. Device 8756
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
06:00.0 USB controller: ASMedia Technology Inc. ASM2142 USB 3.1 Host Controller
	Subsystem: ASUSTeK Computer Inc. Device 8756
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
07:00.0 Non-Volatile memory controller: Phison Electronics Corporation E16 PCIe4 NVMe Controller (rev 01)
	Subsystem: Phison Electronics Corporation E16 PCIe4 NVMe Controller
	Kernel driver in use: nvme

And finally, xrandr:

$ xrandr --listproviders
Providers: number : 1
Provider 0: id: 0x1ca cap: 0x1, Source Output crtcs: 4 outputs: 7 associated providers: 0 name:NVIDIA-0

Regarding the question as to whether the issue is kernel related; using kernel 5.13.13-arch1-1 (Linux-x86_64) with nvidia-dkms, I am able to perfectly reproduce the issue.

Here is another example of a Java GUI applet that uses a native Java call to draw its window. As you can see, it also does not load its graphics, and instead renders this light-blue colour. N.B. unlike with Ghidra, this application does not draw the WM frame, and instead provides such functions through its GUI. However, this detail does not seem to be relevant as all Java windows are similarly affected.

Broken Java GUI #2

Thank you again for your continued assistance.

Last edited by nx_frost (2021-08-31 20:51:00)


Sic itur ad astra.

Offline

#6 2021-08-31 21:37:53

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] All Java GUI applications fail to properly render graphics

Try starting a java program from commandline while prepending  LIBGL_ALWAYS_SOFTWARE=true before the command.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2021-09-01 11:34:59

nx_frost
Member
From: Canada
Registered: 2021-08-28
Posts: 7

Re: [SOLVED] All Java GUI applications fail to properly render graphics

Unfortunately it produces the same result as before.


Sic itur ad astra.

Offline

#8 2021-09-03 10:01:53

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] All Java GUI applications fail to properly render graphics

Time to try another approach, maybe we can rule out java as cause .

Install freecol from repos .

It is a game that is programmed completely in java, the provided jar files  run on linux , windows and OS X.
All it's external librairies are also loaded as jar files and it has extensive logging.

start it , and post ~/.cache/freecol/freecol.log .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#9 2021-09-03 11:42:50

nx_frost
Member
From: Canada
Registered: 2021-08-28
Posts: 7

Re: [SOLVED] All Java GUI applications fail to properly render graphics

Wall of text follows:

$ cat ~/.cache/freecol/FreeCol.log
FreeCol game version: 0.11.6 (Revision: 5f9dd8a)
FreeCol protocol version: 0.1.6

Java vendor: Oracle Corporation
Java version: 11.0.12
Java WM name: OpenJDK 64-Bit Server VM
Java WM vendor: Oracle Corporation
Java WM version: 11.0.12+7

OS name: Linux
OS architecture: amd64
OS version: 5.13.13-zen1-1-zen

net.sf.freecol.common.util.LogBuilder log
	INFO: In /usr/share/java/freecol/data/mods found mod: daySeasons hutzli example convertUpgrade weekSeasons bryce classic_ui misiulo fourSeasons monthSeasons plantForest markovoss
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.FreeCol main
	INFO: FreeCol now stores user data according to the XDG standard, with configuration files in ~/.config/freecol, data files in ~/.local/share/freecol, and log files in ~/.cache/freecol.  Data found in the old ~/.freecol location has been copied to the new locations but not deleted.
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.FreeCol main
	INFO: Configuration:
	  version     0.11.6 (Revision: 5f9dd8a)
	  java:       11.0.12
	  memory:     536870912
	  locale:     en_US
	  data:       /usr/share/java/freecol/data
	  userConfig: /home/frost/.config/freecol
	  userData:   /home/frost/.local/share/freecol
	  autosave:   /home/frost/.local/share/freecol/save/autosave
	  logFile:    /home/frost/.cache/freecol/FreeCol.log
	  options:    /home/frost/.config/freecol/freecol/options.xml
	  save:       /home/frost/.local/share/freecol/save
	  userMods:   /home/frost/.local/share/freecol/mods
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.SwingGUI <init>
	INFO: GUI constructed using scale factor 1.0
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.FontResource <init>
	INFO: Loaded font: Serif.plain from: urn:font:Serif-PLAIN-12
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.FontResource <init>
	INFO: Loaded font: Dialog.plain from: urn:font:Dialog-PLAIN-12
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.FontResource <init>
	INFO: Loaded font: ShadowedBlack from: file:/usr/share/java/freecol/data/base/resources/fonts/ShadowedBlack.ttf
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.util.LogBuilder log
	INFO: Resource mapping, /usr/share/java/freecol/data/base/resources.properties loaded, /usr/share/java/freecol/data/base/resources_en.properties not found, /usr/share/java/freecol/data/base/resources_en_US.properties not found
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.ResourceManager setBaseMapping
	INFO: setBaseMapping net.sf.freecol.common.resources.ResourceMapping@5a45133e
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.ResourceManager$1 run
	INFO: Background thread started
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 20
net.sf.freecol.common.resources.ResourceManager$1 run
	INFO: Background thread preloaded 27 resources.
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 20
net.sf.freecol.common.util.LogBuilder log
	INFO: Resource mapping, /usr/share/java/freecol/data/rules/freecol/resources.properties loaded, /usr/share/java/freecol/data/rules/freecol/resources_en.properties not found, /usr/share/java/freecol/data/rules/freecol/resources_en_US.properties not found
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.util.LogBuilder log
	INFO: Resource mapping, /usr/share/java/freecol/data/rules/classic/resources.properties loaded, /usr/share/java/freecol/data/rules/classic/resources_en.properties not found, /usr/share/java/freecol/data/rules/classic/resources_en_US.properties not found
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.ResourceManager setTcMapping
	INFO: setTcMapping net.sf.freecol.common.resources.ResourceMapping@8462f31
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.ResourceManager$1 run
	INFO: Background thread started
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 22
net.sf.freecol.client.FreeColClient loadClientOptions
	INFO: Load default client options.
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.client.FreeColClient loadClientOptions
	INFO: Load client options from the action manager.
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.ResourceManager setModMapping
	INFO: setModMapping net.sf.freecol.common.resources.ResourceMapping@488d1cd7
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.common.resources.ResourceManager$1 run
	INFO: Background thread cancelled after it preloaded 429 resources.
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 22
net.sf.freecol.common.resources.ResourceManager$1 run
	INFO: Background thread started
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 24
net.sf.freecol.client.control.SoundController <init>
	INFO: Create sound controller with net.sf.freecol.common.option.AudioMixerOption:model.option.audioMixer/[model.option.audioVolume 100%]
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.SwingGUI startGUI
	INFO: sun.java2d.pmoffscreen using client option: true
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.Canvas <init>
	INFO: Windowed mode used.
	Fri Sep 03 05:36:09 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.FreeColFrame <init>
	INFO: Frame created in size 2560x1440
	Fri Sep 03 05:36:10 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.Canvas <init>
	INFO: Canvas created.
	Fri Sep 03 05:36:10 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.SwingGUI startGUI
	INFO: GUI created.
	Fri Sep 03 05:36:10 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.SwingGUI startGUI
	INFO: Starting in Move Units View Mode
	Fri Sep 03 05:36:10 MDT 2021
	Thread: 1
net.sf.freecol.client.gui.FreeColFrame$1 componentResized
	INFO: Window size changes to java.awt.Dimension[width=2570,height=1423]
	Fri Sep 03 05:36:10 MDT 2021
	Thread: 18
net.sf.freecol.client.gui.FreeColFrame$1 componentResized
	INFO: Window size changes to java.awt.Dimension[width=2570,height=1423]
	Fri Sep 03 05:36:10 MDT 2021
	Thread: 18
net.sf.freecol.common.resources.ResourceManager$1 run
	INFO: Background thread preloaded 1273 resources.
	Fri Sep 03 05:36:10 MDT 2021
	Thread: 24

Note that when I opened the game, it looked exactly the same as when I attempted to launch Ghidra. The same bluish purple splash screen. The application has clear audio, and otherwise seems to be interactable. However, still no graphics.


Sic itur ad astra.

Offline

#10 2021-09-03 22:12:18

nx_frost
Member
From: Canada
Registered: 2021-08-28
Posts: 7

Re: [SOLVED] All Java GUI applications fail to properly render graphics

I have done some more digging and with the help of inspecting some GL calls I have determined the issue to be OpenGL related. As of yet I am still unsure precisely what is causing this issue. Systems all report to be functioning and ready to go, however within Firefox, WebGL refuses to load even when forced in the developer settings.

I will continue looking into it and provide another update if/when I've got it sorted for certain. That said, help is still welcome.

Thanks again


Sic itur ad astra.

Offline

#11 2021-09-04 11:57:31

nx_frost
Member
From: Canada
Registered: 2021-08-28
Posts: 7

Re: [SOLVED] All Java GUI applications fail to properly render graphics

The issue has now been resolved.

As far as determining precisely what the issue was, I can't say, but it certainly had to do with my OpenGL configuration. Though my system reported everything relating to my GPU and GLX to be working just fine, the reality was that nothing that required hwaccel or GLX would run properly. So, I nuked any packages to do with Nvidia, va-api, vdpau, OpenGL, reacquired only the necessities to build nvidia-dkms and installed vdpau. Verified everything using glxinfo, cleared Nvidia cache, tidied up my Xorg configuration and rebooted. Upon login, all previously non-functional programs are now functional, including WebGL within the browser and OpenGL/DirectX elsewhere.

This was my primary page of reference, but many of the subpages it references were also particularly helpful.



Cheers.


Sic itur ad astra.

Offline

#12 2021-09-04 12:11:27

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] All Java GUI applications fail to properly render graphics

I was almost out of ideas, glad you figured it out.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB