CRaC's classpath handling code imposes stricter requirements on classpath property than the normal JDK does.
For example, running `java -version -cp "file:/C:\System"` on Windows will successfully print the version description in normal JDK but will error in CRaC-ed JDK:
```
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
at java.io.FileInputStream.<init>(java.base/FileInputStream.java:593)
at java.lang.System.initPhase1(java.base/System.java:2218)
Caused by: java.nio.file.InvalidPathException: Illegal char <:>
at sun.nio.fs.WindowsPathParser.normalize(java.base/WindowsPathParser.java:204)
at sun.nio.fs.WindowsPathParser.parse(java.base/WindowsPathParser.java:175)
at sun.nio.fs.WindowsPathParser.parse(java.base/WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(java.base/WindowsPath.java:92)
at sun.nio.fs.WindowsFileSystem.getPath(java.base/WindowsFileSystem.java:231)
at java.nio.file.Path.of(java.base/Path.java:148)
at jdk.internal.crac.JDKFileResource.<clinit>(java.base/JDKFileResource.java:49)
at java.io.FileInputStream.<init>(java.base/FileInputStream.java:593)
at java.lang.System.initPhase1(java.base/System.java:2218)
```
For example, running `java -version -cp "file:/C:\System"` on Windows will successfully print the version description in normal JDK but will error in CRaC-ed JDK:
```
Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
at java.io.FileInputStream.<init>(java.base/FileInputStream.java:593)
at java.lang.System.initPhase1(java.base/System.java:2218)
Caused by: java.nio.file.InvalidPathException: Illegal char <:>
at sun.nio.fs.WindowsPathParser.normalize(java.base/WindowsPathParser.java:204)
at sun.nio.fs.WindowsPathParser.parse(java.base/WindowsPathParser.java:175)
at sun.nio.fs.WindowsPathParser.parse(java.base/WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(java.base/WindowsPath.java:92)
at sun.nio.fs.WindowsFileSystem.getPath(java.base/WindowsFileSystem.java:231)
at java.nio.file.Path.of(java.base/Path.java:148)
at jdk.internal.crac.JDKFileResource.<clinit>(java.base/JDKFileResource.java:49)
at java.io.FileInputStream.<init>(java.base/FileInputStream.java:593)
at java.lang.System.initPhase1(java.base/System.java:2218)
```
- links to
-
Commit(crac) openjdk/crac/d5ab9565
-
Review(crac) openjdk/crac/168