Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 493354

Summary: Standalone applications fail on MacOSX El Capitan due to JDK-8143907 when using Java 7.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: MiscAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) RC1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Alexander Nyßen CLA 2016-05-10 11:07:12 EDT
Because of https://bugs.openjdk.java.net/browse/JDK-8143907 certain standalone examples fail on El Capitan with the following NPE: 

java.lang.NullPointerException
	at com.sun.t2k.MacFontFinder.initPSFontNameToPathMap(MacFontFinder.java:339)
	at com.sun.t2k.MacFontFinder.getFontNamesOfFontFamily(MacFontFinder.java:390)
	at com.sun.t2k.T2KFontFactory.getFontResource(T2KFontFactory.java:232)
	at com.sun.t2k.LogicalFont.getSlot0Resource(LogicalFont.java:184)
	at com.sun.t2k.LogicalFont.getSlotResource(LogicalFont.java:228)
	at com.sun.t2k.CompositeStrike.getStrikeSlot(CompositeStrike.java:86)
	at com.sun.t2k.CompositeStrike.getMetrics(CompositeStrike.java:132)
	at com.sun.javafx.font.PrismFontUtils.getFontMetrics(PrismFontUtils.java:31)
	at com.sun.javafx.font.PrismFontLoader.getFontMetrics(PrismFontLoader.java:451)
	at javafx.scene.text.Text.<init>(Text.java:153)
	at javafx.scene.text.Text.<init>(Text.java:162)

As J2SE-1.7 is still to be supported for Neon, we should probably provide a workaround.
Comment 1 Alexander Nyßen CLA 2016-05-10 11:26:10 EDT
- Added a static initializer to FXDomain, which provides a workaround for JDK-8143907 on Java 7 and Mac OS X El Capitan in standalone mode.
- Added a TODO to remove the respective functionality when dropping support for JavaSE-1.7.

Resolving as fixed in 4.0.0 RC1.