title: Java8 FileSystems.getDefault() throws ExceptionInInitializerError caused by NullPointerException in WindowsPathParser
body: <p>A simple call to Paths.get() throws ExceptionInInitializerError caused by NullPointerException in WindowsPathParser. I am using Oracle jdk 1.8.0_131 64 bit on Windows7 Enterprise.</p>
  
  <pre><code>static Path outPath;
  
  public static void main(String[] args) {
      outPath = Paths.get("data");
  }
  </code></pre>
  
  <p>Exception stack trace</p>
  
  <pre><code>Exception in thread "main" java.lang.ExceptionInInitializerError
  at java.nio.file.FileSystems.getDefault(FileSystems.java:176)
  at java.nio.file.Paths.get(Paths.java:84)
  at com.xpo.or.agg.specific.Program.instantiate(Program.java:62)
  at com.xpo.or.agg.specific.Program.main(Program.java:32)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
  Caused by: java.lang.NullPointerException
  at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:98)
  at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
  at sun.nio.fs.WindowsFileSystem.&lt;init&gt;(WindowsFileSystem.java:57)
  at sun.nio.fs.WindowsFileSystemProvider.&lt;init&gt;(WindowsFileSystemProvider.java:53)
  at sun.nio.fs.DefaultFileSystemProvider.create(DefaultFileSystemProvider.java:36)
  at java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:108)
  at java.nio.file.FileSystems$DefaultFileSystemHolder.access$000(FileSystems.java:89)
  at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:98)
  at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:96)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:96)
  at java.nio.file.FileSystems$DefaultFileSystemHolder.&lt;clinit&gt;(FileSystems.java:90)
  </code></pre>
  
  <p>The only problem I can think of is some side effect between static member Program class initialization and <strong>java.nio.file.FileSystems</strong> initialization.</p>
  
  <p>java.lang.ExceptionInInitializerError signals that an unexpected exception has occurred in a static initializer.
   An <code>ExceptionInInitializerError</code> is thrown to indicate that an
   exception occurred during evaluation of a static initializer or the
   initializer for a static variable.</p>
  
  <p>Any help is appreciated.</p>