JDK-8174736 : [JCP] [Mac]Cannot launch JCP on Mac os with language set to "Chinese, Simplified" while region is not China
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2017-02-10
  • Updated: 2017-07-05
  • Resolved: 2017-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u152Resolved 9 b160Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Checked with latest JDK9 b155, JCP cannot be launched if both conditions meet:
1. In System Preferences -> Language & Region, set primary language to "Chinese, Simplified".
2. Set Region other than China.

JCP will fail to launch with exceptions seen in command line.

This does not seem to be a regression issue and is similar to JDK-8162453, while JDK-8162453 says it is fixed in JDK9 b133 already.

Error  log:
scaaa831:~ uadmin$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+155)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+155, mixed mode)
scaaa831:~ uadmin$ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/jcontrol
2017-02-09 21:35:17.565 java[45177:14838713] Original euid:501
2017-02-09 21:35:17.568 java[45177:14838713] Original euid:501
Exception in Application start method
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javafx.fxml.LoadException:
/jdk.deploy.controlpanel/com/sun/deploy/jcp/fxml/JCP.fxml

        at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
        at jdk.deploy.controlpanel@9-ea/com.sun.deploy.jcp.Main.start(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
Caused by: java.lang.RuntimeException: javafx.fxml.LoadException:
/jdk.deploy.controlpanel/com/sun/deploy/jcp/fxml/MacUpdate.fxml

        at jdk.deploy.controlpanel@9-ea/com.sun.deploy.jcp.controller.JCP.initialize(Unknown Source)
        ... 14 more
Caused by: javafx.fxml.LoadException:
/jdk.deploy.controlpanel/com/sun/deploy/jcp/fxml/MacUpdate.fxml

        at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
        at javafx.fxml/javafx.fxml.FXMLLoader.load(Unknown Source)
        ... 15 more
Caused by: java.util.IllformedLocaleException: Ill-formed language: zh-hans [at index 0]
        at java.base/java.util.Locale$Builder.setLocale(Unknown Source)
        at java.base/sun.util.locale.provider.HostLocaleProviderAdapterImpl.getCalendarLocale(Unknown Source)
        at java.base/sun.util.locale.provider.HostLocaleProviderAdapterImpl.access$600(Unknown Source)
        at java.base/sun.util.locale.provider.HostLocaleProviderAdapterImpl$2.getDateInstance(Unknown Source)
        at java.base/java.text.DateFormat.get(Unknown Source)
        at java.base/java.text.DateFormat.get(Unknown Source)
        at java.base/java.text.DateFormat.getDateInstance(Unknown Source)
        at jdk.deploy.controlpanel@9-ea/com.sun.deploy.jcp.controller.UpdateTab.refreshAutoUpdatePanel(Unknown Source)
        at jdk.deploy.controlpanel@9-ea/com.sun.deploy.jcp.controller.UpdateTab.initialize(Unknown Source)
        ... 22 more
Exception running application com.sun.deploy.jcp.Main

Comments
Verified with 9 b162. JCP can be launched in both Chinese-Simplified and Chinese-Traditional language without changing the region.
2017-03-29

Although Locale.getDefault() returning zh-hant as the user.language was fixed with JDK-8174779, there is still cases where zh-hant slips through default locales, such as user.language.format. In this specific scenario, HostLocaleProviderAdapter uses the default format locale for formatting dates for the trace file. This issue could easily be reproducible with simply running DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL), with -Djava.locale.providers=HOST specified.
2017-03-03

With the latest build: b159, it looks like there is an issue opening JCP in Chinese locale if the "Enable trace" option is checked. The JCP code is not causing this issue. It's caused because of the way Locale is handling the new format for chinese locales - zh-hans and zh-hant.
2017-03-03

This issue is a duplicate of https://bugs.openjdk.java.net/browse/JDK-8171818 This is a Mac 10.12 only issue. Not for other versions of mac. Closing this bug as a dup
2017-02-13

This appears to be a regression of JDK-8162453.
2017-02-10