JDK-8240197 : Cannot start JVM when $JAVA_HOME includes CJK characters
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11.0.6,13.0.2,14,15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2020-02-28
  • Updated: 2021-10-27
  • Resolved: 2020-03-05
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 Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14 JDK 15
11.0.15-oracleFixed 13.0.6Fixed 14.0.2Fixed 15 b14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
JVM cannot start as below when CJK characters are included in $JAVA_HOME.

```
PS > .\build\windows-x86_64-server-fastdebug\images\jdk日本語\bin\java.exe --version
Error occurred during initialization of VM
Failed setting boot class path.
```

I think this bug has been occurred since JDK-8191521.
It uses mbstowcs_s() to convert char* to wchar_t*. But Windows API for wchar_t* (they are named *W()) requires Unicode chars for their arguments. mbstowcs_s() would not convert to Unicode. We need to use MultiByteToWideChar().

This issue has been also confirmed in AdoptOpenJDK 11.0.6 [1]. So we also need to change jdk11u.

[1] https://github.com/AdoptOpenJDK/openjdk-build/issues/1496
Comments
Fix request (13u). I would like to backport the fix to jdk13u for parity with jdk11u. The original patch applied cleanly.
06-12-2020

This fix seems incomplete - see JDK-8241461
24-03-2020

Hi Yasumasa, I discussed it with the other maintainers. While simple regression testing seems fine, we decide to defer this to 11.0.8, given it's a non-trivial change that hasn't have a lot of baking time yet. Please push to jdk11u-dev. Workaround should be to deploy/symlink the binary to non CJK paths. Thanks for your understanding.
10-03-2020

Hi Christoph, Thank you for evaluating this change for 11u, and I got it. I will backport this change to jdk11u-dev.
10-03-2020

No, we cannot avoid this issue. We need to deploy JDK to the path or to create symlink which does not contain CJK chars.
08-03-2020

Would these people have a workaround?
08-03-2020

Hi Christoph, Thanks for your comment! I think some people in CJK area (including Japanese) want this change, but if it it could not ride release train for 11.0.7, it can't be helped. Should I change jdk11u-critical-request to jdk11u-fix-request?
06-03-2020

Hi Yasu, the fix was just pushed to JDK head yesterday. Though I hope that there's no regression with it, I would feel more comfortable if we could defer it to 11.0.8, given that 11.0.7 is ramping down now and dev close is getting near. Would that be ok for you?
06-03-2020

Fix Request (OpenJDK 11u): JDK could not start when it is deployed on the path which includes CJK chars due to JDK-8191521 which introduced in 11.0.6 . So I want to backport it to 11.0.7. This issue appears in boot time, thus we can test it in jtreg tests.
05-03-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/c4dea8e07b84 User: ysuenaga Date: 2020-03-05 10:46:52 +0000
05-03-2020