Menu

#14 NullPointerException due to missing mrj.version on Mac OS X Sierra (10.12.5)

v1.0 (example)
open
nobody
None
2
2017-07-20
2017-07-20
No

I recently came across BrowserLauncher2 while looking for a platform independant mechanism for opening a default browser with more reliability than the java.awt.Desktop API provides.

Unfortunately it doesn't work on Mac OS X Sierra (10.12.5). The BrowserLaunching factory assumes the existence of the mrj.version system property which is not defined. Running java -XshowSettings:properties confirms the property isn't there. The subsequent attempt to call substring on the result of the System.getProperty call throws a NullPointerException, killing the application at that point.

Discussion


Log in to post a comment.