JDK-6795536 : No system start for file.encoding=x-SJIS_0213
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio.charsets
  • Affected Version: 6u14,7
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2009-01-20
  • Updated: 2018-09-11
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 6 Other
6-poolResolved tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b43)
Java HotSpot(TM) Client VM (build 14.0-b10, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Windows XP SR-2

A DESCRIPTION OF THE PROBLEM :
run:
java -Dfile.encoding=x-SJIS_0213 Hello_SJIS

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run:
java -Dfile.encoding=x-SJIS_0213 Hello_SJIS


ERROR MESSAGES/STACK TRACES THAT OCCUR :
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
        at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1325)
        at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1307)
        at java.lang.ClassLoader.getSystemResource(ClassLoader.java:1092)
        at java.lang.ClassLoader.getSystemResourceAsStream(ClassLoader.java:1202
)
        at java.lang.Class.getResourceAsStream(Class.java:2042)
        at sun.nio.cs.ext.SJIS_0213.<clinit>(SJIS_0213.java:76)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at sun.nio.cs.AbstractCharsetProvider.lookup(AbstractCharsetProvider.jav
a:142)
        at sun.nio.cs.AbstractCharsetProvider.charsetForName(AbstractCharsetProv
ider.java:161)
        at java.nio.charset.Charset.lookupExtendedCharset(Charset.java:459)
        at java.nio.charset.Charset.lookup2(Charset.java:484)
        at java.nio.charset.Charset.lookup(Charset.java:472)
        at java.nio.charset.Charset.defaultCharset(Charset.java:615)
        at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:56)

        at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:111)
        at java.io.PrintStream.<init>(PrintStream.java:117)
        at java.lang.System.initializeSystemClass(System.java:1114)
Caused by: java.lang.NullPointerException
        at sun.nio.cs.ext.SJIS_0213$Decoder.decodeSingle(SJIS_0213.java:184)
        at sun.nio.cs.ext.SJIS_0213$Decoder.decodeArrayLoop(SJIS_0213.java:98)
        at sun.nio.cs.ext.SJIS_0213$Decoder.decodeLoop(SJIS_0213.java:178)
        at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:561)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:317)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
        at java.io.InputStreamReader.read(InputStreamReader.java:184)
        at java.io.BufferedReader.fill(BufferedReader.java:153)
        at java.io.BufferedReader.readLine(BufferedReader.java:316)
        at java.io.BufferedReader.readLine(BufferedReader.java:379)
        at sun.misc.MetaIndex.registerDirectory(MetaIndex.java:178)
        at sun.misc.Launcher$ExtClassLoader$1.run(Launcher.java:143)
        at sun.misc.Launcher$ExtClassLoader$1.run(Launcher.java:139)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.misc.Launcher$ExtClassLoader.getExtClassLoader(Launcher.java:138)

        at sun.misc.Launcher.<init>(Launcher.java:71)
        at sun.misc.Launcher.<clinit>(Launcher.java:59)
        at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1325)
        at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1307)
        at java.lang.ClassLoader.getSystemResource(ClassLoader.java:1092)
        at java.lang.ClassLoader.getSystemResourceAsStream(ClassLoader.java:1202
)
        at java.lang.Class.getResourceAsStream(Class.java:2042)
        at sun.nio.cs.ext.SJIS_0213.<clinit>(SJIS_0213.java:76)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at sun.nio.cs.AbstractCharsetProvider.lookup(AbstractCharsetProvider.jav
a:142)
        at sun.nio.cs.AbstractCharsetProvider.charsetForName(AbstractCharsetProv
ider.java:161)
        at java.nio.charset.Charset.lookupExtendedCharset(Charset.java:459)
        at java.nio.charset.Charset.lookup2(Charset.java:484)
        at java.nio.charset.Charset.lookup(Charset.java:472)
        at java.nio.charset.Charset.defaultCharset(Charset.java:615)
        at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:56)

        at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:111)
        at java.io.PrintStream.<init>(PrintStream.java:117)
        at java.lang.System.initializeSystemClass(System.java:1114)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/**
 *
 * @author Ulf Zibis <Ulf.Zibis at CoSoCo.de>
 */
public class Hello_SJIS {

    public static void main(String[] args) {
        System.out.println("Hello SJIS");
    }

}

---------- END SOURCE ----------

Comments
The older webrev is now attached to bug JDK-8177314.
17-04-2017

SUGGESTED FIX See attached webrevs from OpenJDK bugzilla.
23-07-2012

EVALUATION (1)file.encoding is a READ-ONLY informative system property, don't try to "play" with it. (2)yes, it's an issue that sjis_0213 fails to be a boot cs.
20-01-2009