JDK-8241461 : Can't start JVM when java path includes CJK chars and code-page is English
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_10
  • Submitted: 2020-03-23
  • Updated: 2021-10-27
  • Resolved: 2020-03-24
Related Reports
Relates :  
Relates :  
Relates :  
Description
Running Java on Windows with CJK (Chinese-Japanese-Korean) chars in the path fails if default code-page is English.

D:\>jdk-15_windows-x64_bin-debug\jdk-15\jdk日本語\bin\java.exe -version
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
Comments
Still no luck: D:\>chcp Active code page: 437 D:\>chcp 932 Active code page: 932 D:\>jdk-15_windows-x64_bin-debug\jdk-15\jdk日本語\bin\java.exe -version Error: could not find java.dll Error: Could not find Java SE Runtime Environment. D:\>jdk-15_windows-x64_bin-debug\jdk-15\jdk日本語\bin\java.exe -Dfile.encoding=UTF-8 -version Error: could not find java.dll Error: Could not find Java SE Runtime Environment.
24-03-2020

See comments from Yasumasa
24-03-2020

I think it is not a problem because CP437 does not have Japanese Kanji chars ("日本語" means "Japanese" in Kanji). MultiByteToWideChar() with CP_THREAD_ACP would work with code page of current thread, so it cannot work if active code page does not support Japanese in this case. In NTFS, Unicode is used for file name. Thus you might be access "jdk日本語" if you set Unicode code page. However FAT uses system locale. So I think we cannot fix this issue in all cases in Windows. https://docs.microsoft.com/en-us/windows/win32/intl/character-sets-used-in-file-names
24-03-2020

JDK-8240197 converts to Unicode with CP_THREAD_ACP. Does it work if you exec `chcp 932` before starting java? (I assume you made "jdk日本語" on CP932)
24-03-2020