Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Substance] Crash during initialization on null desktop hints #184
Version of Radiance (current development is 2.5-SNAPSHOT)
Version of Java (current minimum is 9)
java version "12.0.1" 2019-04-16
Version of OS
Description: Fedora release 28 (Twenty Eight)
The issue you're experiencing (expected vs actual, screenshot, stack trace etc)
I'm going through the document for getting started with Substance Look And Feel. I'm doing the manual process of building Radiance with gradle using the Walkthrough example. I use the following script to run the frame under Substance:
But this still results with:
What am I missing? Thanks.
This works for me:
java -cp .:drop/2.5-SNAPSHOT/core/radiance-substance-2.5-SNAPSHOT.jar:drop/2.5-SNAPSHOT/core/radiance-trident-2.5-SNAPSHOT.jar:drop/2.5-SNAPSHOT/core/radiance-neon-2.5-SNAPSHOT.jar -Dswing.defaultlaf=org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel Walkthrough
You can use "jar tvf" to inspect the contents of /home/max/tmp/radiance-substance-2.5-SNAPSHOT.jar to verify that it was built properly - that is, that it contains the org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel class.
I tried those steps with Java 9 and Java 12. Worked for me under both.
I would start by inspecting the contents of the jars that you've built locally to see what's inside - and comparing the contents with the prebuilt binaries from https://github.com/kirill-grouchnikov/radiance/tree/master/drop/2.5-SNAPSHOT/core
As a follow-up in case this is somehow important/interesting, I managed to get it working. When running the default look and feel, I observed that the font was not anti-aliased by default on my machine (Fedora 28, using i3-gaps as a window manager). I wondered if this was somehow related and did some reading on Java runtime environment fonts. In essence the fonts looked like this:
It turns out that setting this property when launching Walkthrough with Radiance makes it work:
Removing this property results in the error of Java being unable to load org.pushingpixels.substance.api.skin.SubstanceBusinessLookAndFeel.
Reading here has more information. I assume because I have customised my Fedora 28 setup (I don't use gnome) is the reason I don't have an
Is there anything in the stack that is a bit more informative than just "Cannot load ..."? It very may well be a bug in Substance that is then converted to a more generic stack trace that masks away the original exception.
Can't say for sure without being able to reproduce this on my machine. Substance definitely uses desktop hints to configure font rendering during its initialization. Maybe there's a bug there that is only reproduced under very specific conditions.
Setting the look and feel via code also throughs an exception if I don't use
The source used for this execution is as follows:
What's different this time is that the JFrame is somewhat rendered with substance, just not completely, see below:
Hope this helps, happy to do further digging if you have suggestions.
The assumption is that the relevant desktop property is never null. Apparently that's a wrong assumption. Will fix.