oracle / visualvm

VisualVM is an All-in-One Java Troubleshooting Tool
https://visualvm.github.io/
Other
2.86k stars 300 forks source link

setting L&F cause crash #386

Closed umjammer closed 2 years ago

umjammer commented 2 years ago

Describe the bug

adding look and feel settings to configuration file cause crush.

like

visualvm_default_options="-J-Xms24m -J-Xmx768m -J-Dnetbeans.accept_license_class=org.graalvm.visualvm
<< abbreviation>>
VMOptions -J-cp=/Users/nsano/.m2/repository/com/formdev/flatlaf/1.6.1/flatlaf-1.6.1.jar -J-Dswing.defaultlaf=com.formdev.flatlaf.FlatLightLaf"

To Reproduce Steps to reproduce the behavior:

  1. edit /Applications/VisualVM.app/Contents/Resources/visualvm/etc/visualvm.conf
  2. add look and feel option like above
  3. run by command line
  4. See error

Expected behavior exec correctly

VisualVM log

$ /Applications/VisualVM.app/Contents/MacOS/visualvm
WARNING: package com.sun.java.swing.plaf.gtk not in java.desktop
WARNING: package sun.awt.X11 not in java.desktop
java.lang.NullPointerException: Cannot invoke "javax.swing.LookAndFeel.getID()" because "<local0>" is null
    at org.netbeans.core.windows.view.ui.MainWindow.logLookAndFeelUsage(MainWindow.java:887)
    at org.netbeans.core.windows.view.ui.MainWindow.init(MainWindow.java:153)
    at org.netbeans.core.windows.WindowSystemImpl.init(WindowSystemImpl.java:46)
    at org.netbeans.core.GuiRunLevel.initializeMainWindow(GuiRunLevel.java:127)
    at org.netbeans.core.GuiRunLevel.run(GuiRunLevel.java:72)
    at org.netbeans.core.startup.Main.start(Main.java:295)
    at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
    at java.base/java.lang.Thread.run(Thread.java:833)

Screenshots n/a

Desktop (please complete the following information):

Additional context previous version (it's overridden by 2.1.2, so i couldn't get) visualvm was working w/ that l&f option.

thurka commented 2 years ago

Please attach whole messages.log file. Thanks.

umjammer commented 2 years ago

here it is.

visualvm-log.zip

it's located at ~/Library/Application Support/VisualVM/2.1.2/var/log is it documented?


and i found previous version is 2.1.1, because there is the directory named that version.

jisedlac commented 2 years ago

A quick tip - have you tried the VisualVM --laf argument to set the LaF instead of -J-Dswing.defaultlaf?

Please see https://visualvm.github.io/docs/command-line-options.html#appearance_options and the example right above this section, for --cp:p and --cp:a.

umjammer commented 2 years ago

it works!

i just remembered user configuration file is located at ~/Library/Application Support/VisualVM/x.x.x/etc visualvm.conf for 1.2.1 is still there... i used --laf and --cp:a for 1.2.1 ...

sorry about the fuss