[ARCH] Darcula Theme Issue

Support for Ubuntu and other Desktop Linux distributions
Post Reply
Lessaj
Posts: 4
Joined: 01 Jun 2019, 00:53

[ARCH] Darcula Theme Issue

Post by Lessaj »

Hi,

Some time ago I noticed that Filebot was no longer following my Gnome shell theme, I think it was after a Gnome shell update so I thought nothing of it since I didn't want to downgrade the shell and functionally it still worked. I came across this post which explains how to switch to Darcula but I receive a null pointer exception when trying to start the application after this. Metal and Nimbus both work fine, though Nimbus has some rendering errors on the buttons and while I don't know why that is happening I do know this is due to using precompilled mesagit instead of regular mesa, they appear fine with the regular mesa package and this the only app that has a rendering issue. I'm not concerned with that since I'd rather get the dark theme working. :)

Installed packages:

jdk8-openjdk 8.u212-1
jre8-openjdk 8.u212-1
java-openjfx 8.u172-2

if I missed any that may be important for this let me know and I will provide that as well. Here is the NPE.

Code: Select all

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
	at com.bulenkov.iconloader.IconLoader.<clinit>(IconLoader.java:53)
	at com.bulenkov.darcula.DarculaLaf.getDefaults(DarculaLaf.java:97)
	at javax.swing.UIManager.setLookAndFeel(UIManager.java:539)
	at net.filebot.ui.ThemeSupport$Theme$3.setLookAndFeel(ThemeSupport.java:142)
	at net.filebot.ui.ThemeSupport.setTheme(ThemeSupport.java:43)
	at net.filebot.ui.ThemeSupport.setTheme(ThemeSupport.java:37)
	at net.filebot.Main.startUserInterface(Main.java:222)
	at net.filebot.Main.lambda$main$1(Main.java:159)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.NullPointerException
	at com.bulenkov.iconloader.util.UIUtil.initSystemFontData(UIUtil.java:254)
	at com.bulenkov.iconloader.util.JBUI.calculateScaleFactor(JBUI.java:47)
	at com.bulenkov.iconloader.util.JBUI.<clinit>(JBUI.java:33)
	... 22 more
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [ARCH] Darcula Theme Issue

Post by rednoah »

You can file an issue on the GitHub page of the project and see if anybody has an idea:
https://github.com/bulenkov/Darcula

Here's the line from the stack trace:
https://github.com/bulenkov/iconloader/ ... .java#L254


:idea: There's not much we can do here though. Best to just use the default system look and feel.

:?: Since you have multiple JREs installed, it would be interesting to know which one you're using to run FileBot, and if running with the latest, maybe even latest Java 12, makes any difference.
:idea: Please read the FAQ and How to Request Help.
Lessaj
Posts: 4
Joined: 01 Jun 2019, 00:53

Re: [ARCH] Darcula Theme Issue

Post by Lessaj »

Thank you, I will make a post there and ask about it.

FYI, the script for the launcher says /usr/lib/jvm/java-8-openjdk/bin/java and it reports the following.

Code: Select all

openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b01)
OpenJDK 64-Bit Server VM (build 25.212-b01, mixed mode)
I installed jdk-openjdk-11.0.3.u4-1 jre-openjdk-11.0.3.u4-1 and java-openjfx-bin-11.0.2-2 and made a copy of the script changing the java path to /usr/lib/jvm/default/bin/java which I set to be java-11-openjdk via the archlinux-java command. This resulted in some more output but still the same error. I can find a couple issues open with this error. This is pretty detailed as well.

Code: Select all

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.bulenkov.darcula.DarculaLaf (file:/usr/share/java/filebot/darcula.jar) to field javax.swing.text.html.HTMLEditorKit.DEFAULT_STYLES_KEY
WARNING: Please consider reporting this to the maintainers of com.bulenkov.darcula.DarculaLaf
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
	at com.bulenkov.iconloader.IconLoader.<clinit>(IconLoader.java:53)
	at com.bulenkov.darcula.DarculaLaf.getDefaults(DarculaLaf.java:97)
	at java.desktop/javax.swing.UIManager.setLookAndFeel(UIManager.java:587)
	at net.filebot.ui.ThemeSupport$Theme$3.setLookAndFeel(ThemeSupport.java:142)
	at net.filebot.ui.ThemeSupport.setTheme(ThemeSupport.java:43)
	at net.filebot.ui.ThemeSupport.setTheme(ThemeSupport.java:37)
	at net.filebot.Main.startUserInterface(Main.java:222)
	at net.filebot.Main.lambda$main$1(Main.java:159)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NullPointerException
	at com.bulenkov.iconloader.util.UIUtil.initSystemFontData(UIUtil.java:254)
	at com.bulenkov.iconloader.util.JBUI.calculateScaleFactor(JBUI.java:47)
	at com.bulenkov.iconloader.util.JBUI.<clinit>(JBUI.java:33)
	... 21 more
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [ARCH] Darcula Theme Issue

Post by rednoah »

I've applied the workaround suggested in your link:
https://github.com/bulenkov/iconloader/issues/14
:idea: Please read the FAQ and How to Request Help.
Lessaj
Posts: 4
Joined: 01 Jun 2019, 00:53

Re: [ARCH] Darcula Theme Issue

Post by Lessaj »

I modified the AUR PKGBUILD to build the 4.8.6 beta and Darcula is working now! Unfortunately I didn't think to try the beta before the build this morning (01-Jun-2019 07:33) but I'm sure it would have had that same issue. This is great, thank you! Based on the history of the bug reports upstream this issue goes back quite a ways but hasn't been fixed, I wonder what it relies on from the system that the call to getLabelFont returned null... My java days are a little behind me to dig into this. :?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [ARCH] Darcula Theme Issue

Post by rednoah »

Probably just some system fonts not working as expected on Linux, under certain conditions. Things on the Linux Desktop are just a lot less homogenous than Windows / Mac, so lots of chances for things to randomly break.
:idea: Please read the FAQ and How to Request Help.
Lessaj
Posts: 4
Joined: 01 Jun 2019, 00:53

Re: [ARCH] Darcula Theme Issue

Post by Lessaj »

That's likely it, either way thank you for fixing it! Awesome response. :)
Post Reply