NPE on javafx applications on MAC

Viewed 869

This is quite an annoying bug that was - supposed to be - fixed already ( I did some research), but the problem persists on my mac.

I have a simple javaFX application with a button that when clicked on should print hello world. The button itself has some text in it. However, when the application runs, it gives this error:

Caused by: java.lang.NullPointerException
at com.sun.javafx.font.MacFontFinder.populateFontFileNameMap(MacFontFinder.java:99)

(full exception here: http://pastebin.com/YdAgMfPs)

How could this be solved? Mac is on most recent version ( OS X el capitan) and java aswell. I'm using netbeans IDE, but can be reproduced on other IDE's aswell, so I think the problem lies with my machine

2 Answers

I had the same problem (OSX 10.11.6) when using the mvn speedment:tool, which also makes use of JavaFX. Restoring standard fonts made the NPE go away. I later installed latest version (2.37) of DejaVuSansMono.ttf which I use in my Terminal, and the problem did not come back.

Related