FULL PRODUCT VERSION :
$ LANG=C java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+159)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+159, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux rhxxxxx.microfocus.com 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
The locale must be set to Japanese ShiftJIS.
$ export LANG=ja_JP.SJIS
$ locale
LANG=ja_JP.SJIS
LC_CTYPE="ja_JP.SJIS"
LC_NUMERIC="ja_JP.SJIS"
LC_TIME="ja_JP.SJIS"
LC_COLLATE="ja_JP.SJIS"
LC_MONETARY="ja_JP.SJIS"
LC_MESSAGES="ja_JP.SJIS"
LC_PAPER="ja_JP.SJIS"
LC_NAME="ja_JP.SJIS"
LC_ADDRESS="ja_JP.SJIS"
LC_TELEPHONE="ja_JP.SJIS"
LC_MEASUREMENT="ja_JP.SJIS"
LC_IDENTIFICATION="ja_JP.SJIS"
LC_ALL=
$
A DESCRIPTION OF THE PROBLEM :
Invoking 'java' with the locale set to 'ja_JP.SJIS' fails immediately. Even to get the output from 'java -version' I have to temporarily set LANG to C (see the Development Kit or Runtime version).
REGRESSION. Last worked in version 8u121
ADDITIONAL REGRESSION INFORMATION:
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+159)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+159, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Set the locale to be Japanese ShiftJIS - on Linux this is 'ja_JP.SJIS'.
$ export LANG=ja_JP.SJIS
... check the locale...
$ locale
LANG=ja_JP.SJIS
LC_CTYPE="ja_JP.SJIS"
LC_NUMERIC="ja_JP.SJIS"
LC_TIME="ja_JP.SJIS"
LC_COLLATE="ja_JP.SJIS"
LC_MONETARY="ja_JP.SJIS"
LC_MESSAGES="ja_JP.SJIS"
LC_PAPER="ja_JP.SJIS"
LC_NAME="ja_JP.SJIS"
LC_ADDRESS="ja_JP.SJIS"
LC_TELEPHONE="ja_JP.SJIS"
LC_MEASUREMENT="ja_JP.SJIS"
LC_IDENTIFICATION="ja_JP.SJIS"
LC_ALL=
.. which should be what you set, i.e. ja_JP.SJIS.
.. And run java.
$ java
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The usual Java usage options - in Japanese.
But if I set 'LC_MESSAGES' to C I can read it (I can't read Japanese!) and more importantly at this point, cut and paste it...
$ export LC_MESSAGES=C
$ java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
... and so on
ACTUAL -
$ export LANG=ja_JP.SJIS
$ locale
LANG=ja_JP.SJIS
LC_CTYPE="ja_JP.SJIS"
LC_NUMERIC="ja_JP.SJIS"
LC_TIME="ja_JP.SJIS"
LC_COLLATE="ja_JP.SJIS"
LC_MONETARY="ja_JP.SJIS"
LC_MESSAGES="ja_JP.SJIS"
LC_PAPER="ja_JP.SJIS"
LC_NAME="ja_JP.SJIS"
LC_ADDRESS="ja_JP.SJIS"
LC_TELEPHONE="ja_JP.SJIS"
LC_MEASUREMENT="ja_JP.SJIS"
LC_IDENTIFICATION="ja_JP.SJIS"
LC_ALL=
$ java
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
at sun.nio.fs.UnixFileSystem.<init>(java.base/UnixFileSystem.java:51)
at sun.nio.fs.LinuxFileSystem.<init>(java.base/LinuxFileSystem.java:39)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:46)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:39)
at sun.nio.fs.UnixFileSystemProvider.<init>(java.base/UnixFileSystemProvider.java:56)
at sun.nio.fs.LinuxFileSystemProvider.<init>(java.base/LinuxFileSystemProvider.java:41)
at sun.nio.fs.DefaultFileSystemProvider.create(java.base/DefaultFileSystemProvider.java:41)
at java.nio.file.FileSystems.<clinit>(java.base/FileSystems.java:91)
at java.nio.file.Paths.get(java.base/Paths.java:84)
at java.lang.module.ModuleFinder.ofSystem(java.base/ModuleFinder.java:171)
at jdk.internal.module.ModuleBootstrap.boot(java.base/ModuleBootstrap.java:118)
at java.lang.System.initPhase2(java.base/System.java:1928)
Caused by: java.nio.charset.UnsupportedCharsetException: SHIFT_JIS
at java.nio.charset.Charset.forName(java.base/Charset.java:536)
at sun.nio.fs.Util.<clinit>(java.base/Util.java:40)
at sun.nio.fs.UnixFileSystem.<init>(java.base/UnixFileSystem.java:51)
at sun.nio.fs.LinuxFileSystem.<init>(java.base/LinuxFileSystem.java:39)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:46)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:39)
at sun.nio.fs.UnixFileSystemProvider.<init>(java.base/UnixFileSystemProvider.java:56)
at sun.nio.fs.LinuxFileSystemProvider.<init>(java.base/LinuxFileSystemProvider.java:41)
at sun.nio.fs.DefaultFileSystemProvider.create(java.base/DefaultFileSystemProvider.java:41)
at java.nio.file.FileSystems.<clinit>(java.base/FileSystems.java:91)
at java.nio.file.Paths.get(java.base/Paths.java:84)
at java.lang.module.ModuleFinder.ofSystem(java.base/ModuleFinder.java:171)
at jdk.internal.module.ModuleBootstrap.boot(java.base/ModuleBootstrap.java:118)
at java.lang.System.initPhase2(java.base/System.java:1928)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
at sun.nio.fs.UnixFileSystem.<init>(java.base/UnixFileSystem.java:51)
at sun.nio.fs.LinuxFileSystem.<init>(java.base/LinuxFileSystem.java:39)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:46)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:39)
at sun.nio.fs.UnixFileSystemProvider.<init>(java.base/UnixFileSystemProvider.java:56)
at sun.nio.fs.LinuxFileSystemProvider.<init>(java.base/LinuxFileSystemProvider.java:41)
at sun.nio.fs.DefaultFileSystemProvider.create(java.base/DefaultFileSystemProvider.java:41)
at java.nio.file.FileSystems.<clinit>(java.base/FileSystems.java:91)
at java.nio.file.Paths.get(java.base/Paths.java:84)
at java.lang.module.ModuleFinder.ofSystem(java.base/ModuleFinder.java:171)
at jdk.internal.module.ModuleBootstrap.boot(java.base/ModuleBootstrap.java:118)
at java.lang.System.initPhase2(java.base/System.java:1928)
Caused by: java.nio.charset.UnsupportedCharsetException: SHIFT_JIS
at java.nio.charset.Charset.forName(java.base/Charset.java:536)
at sun.nio.fs.Util.<clinit>(java.base/Util.java:40)
at sun.nio.fs.UnixFileSystem.<init>(java.base/UnixFileSystem.java:51)
at sun.nio.fs.LinuxFileSystem.<init>(java.base/LinuxFileSystem.java:39)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:46)
at sun.nio.fs.LinuxFileSystemProvider.newFileSystem(java.base/LinuxFileSystemProvider.java:39)
at sun.nio.fs.UnixFileSystemProvider.<init>(java.base/UnixFileSystemProvider.java:56)
at sun.nio.fs.LinuxFileSystemProvider.<init>(java.base/LinuxFileSystemProvider.java:41)
at sun.nio.fs.DefaultFileSystemProvider.create(java.base/DefaultFileSystemProvider.java:41)
at java.nio.file.FileSystems.<clinit>(java.base/FileSystems.java:91)
at java.nio.file.Paths.get(java.base/Paths.java:84)
at java.lang.module.ModuleFinder.ofSystem(java.base/ModuleFinder.java:171)
at jdk.internal.module.ModuleBootstrap.boot(java.base/ModuleBootstrap.java:118)
at java.lang.System.initPhase2(java.base/System.java:1928)
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
None - I need to use the ShiftJIS locale.