Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8013822

Using file.separator Java option causes ExceptionInInitializerError for Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • None
    • 7u10
    • core-libs

      FULL PRODUCT VERSION :
      java version " 1.7.0_10 "
      Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
      Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows Server 2008 R2 Standard

      Output from command prompt:
      Microsoft Windows [Version 6.1.7600]
      Copyright (c) 2009 Microsoft Corporation. All rights reserved.

      A DESCRIPTION OF THE PROBLEM :
      Trying to run a Java program (e.g. a simple " Hello World " ) with the -Dfile.separator option specified causes an ExceptionInInitializerError.

      java -Dfile.separator=\ Test

      REGRESSION. Last worked in version 7

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      System output:
       " Hello! "
      ACTUAL -
      Stacktrace (see below)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Error occurred during initialization of VM
      java.lang.ExceptionInInitializerError
          at java.lang.Runtime.loadLibrary0(Runtime.java:841)
          at java.lang.System.loadLibrary(System.java:1084)
          at java.lang.System.initializeSystemClass(System.java:1145)
      Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
          at java.lang.String.charAt(String.java:658)
          at java.io.Win32FileSystem.<init>(Win32FileSystem.java:40)
          at java.io.WinNTFileSystem.<init>(WinNTFileSystem.java:37)
          at java.io.FileSystem.getFileSystem(Native Method)
          at java.io.File.<clinit>(File.java:156)
          at java.lang.Runtime.loadLibrary0(Runtime.java:841)
          at java.lang.System.loadLibrary(System.java:1084)
          at java.lang.System.initializeSystemClass(System.java:1145)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Test {
        public static void main(String... args) {
          System.out.println( " Hello! " );
        }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Downgrade to Java 1.7.0_09

            robm Robert Mckenna
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: