Kakifrucht / LightBeat

🎶 Music visualizer for Philips Hue compatible lights.
https://lightbeat.io
GNU General Public License v3.0
44 stars 7 forks source link

Failure to run on arch linux #6

Closed all-yall closed 6 years ago

all-yall commented 6 years ago

i ran the jar file with and without sudo and received this output both times:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.bulenkov.darcula.DarculaLaf (file:/home/spencer/Desktop/LightBeat.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 "main" 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 io.lightbeat.gui.FrameManager.<init>(FrameManager.java:25)
    at io.lightbeat.LightBeat.<init>(LightBeat.java:60)
    at io.lightbeat.LightBeat.main(LightBeat.java:28)
Caused by: java.lang.NullPointerException
    at com.bulenkov.iconloader.util.UIUtil.initSystemFontData(UIUtil.java:252)
    at com.bulenkov.iconloader.util.JBUI.calculateScaleFactor(JBUI.java:47)
    at com.bulenkov.iconloader.util.JBUI.<clinit>(JBUI.java:33)
    ... 6 more
all-yall commented 6 years ago

the code might just need a try catch around the setlookandfeel call so it has the default ui if loading this one fails

all-yall commented 6 years ago

after looking at the source i see that there is a try catch:

 21 
 22     public FrameManager() {
 23         try {
 24             // darcula theme by default
 25             UIManager.setLookAndFeel(new DarculaLaf());
 26         } catch (Exception ignored) {}
 27     }
 28 

the problem might be that i got the code from the website (https://lightbeat.io/) instead of building it from source and the jar on the website is out of date.
that or i'm missing something obvious, in which case it would not be the first time.

Kakifrucht commented 6 years ago

Thanks for bringing this to my attention, I can reproduce the issue on Ubuntu aswell. Unfortunately this is an upstream bug in the Darcula LAF we are using..

I have added the workaround suggested in said ticket. The Exception that is being caught here is actually a subclass of Error and thus wont be caught. I have actually modified said code to log if an Exception is thrown here.

I plan to release version 1.4.0 asap that will include the workaround. Commit https://github.com/Kakifrucht/LightBeat/commit/24d17b29578df8ea4e237e91eb865fd6aac0351e

all-yall commented 6 years ago

After updating the jar file with the fixed FrameManager class it worked perfectly, thanks!

Kakifrucht commented 6 years ago

Fixed in 1.4.0!