I had the same problem this morning. In my app, this java code threw a null pointer exception for this line of code.
Code:
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getBounds();
For some reason, when you have the main monitor set to one that is connected to the dock, getDefualtScreenDevice() returns null.
I was also using java 8.