Mac OS and java.lang.NullPointerException at java.awt.Window.init(Window.java:497)

I had the same issue and I found it reported here.

In my case, I was using a docking station for my MacBook Pro and DisplayLink Driver for extended display. This made Jmeter crash.

The workaround was to disconnect my laptop from its docking station and launching the application.


The solution to this problem was simple, but not immediately obvious.

I dug into the JVM and found that the native code wasn't able to identify a compatible graphics mode from the OS. This results in a null GraphicsConfiguration. That's not good - it causes a NullPointerException in Window.java...guess what line. (Line 497)

I suspected the OS wasn't returning the right information about its graphics setup and then started to suspect the graphics driver. That's when I remembered Macs have parameter RAM (PRAM) and non-volatile RAM (NVRAM).

I zapped the PRAM and NVRAM and now the machine is working fine!

To zap the PRAM and NVRAM:

  1. shut down your mac
  2. restart while holding option+command+P+R
  3. keep holding these until the mac appears to reboot again (the apple logo will appear, disappear, and reappear)

If your mac starts up without the disappearing mac logo, shut it down and retry.

Reset NVRAM or PRAM on your Mac

I hope resetting the PRAM helps others!

Tags:

Java

Macos