JDK-8230291 : Release Note: CDS Behavior Change With Non-existent Files During Archive Creation
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 14
  • Priority: P4
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2019-08-28
  • Updated: 2020-04-27
  • Resolved: 2019-11-08
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 14
14Resolved
Description
In JDK 14, CDS runtime classpath validation is now more forgiving when dealing with files in the classpath that do not exist.

At CDS archive dump time, all non-existent elements in the classpath are automatically stripped. For example, if the command is:

    java -cp nosuchfile.jar:hello.jar -Xshare:dump \
         -XX:SharedClassListFile=hello.classlist \
         -XX:SharedArchiveFile=hello.jsa

after removing the non-existing elements, the classpath recorded in `hello.jsa` becomes `hello.jar`.

Also, at run time, when the CDS archive is loaded, all non-existent elements in the classpath are ignored. With the previous example, all of the following commands will successfully load the archive:

   (1)
```
    java -cp nosuchfile.jar:hello.jar -Xshare:on \
         -XX:SharedArchiveFile=hello.jsa \
         Hello
```
   (2)
```
    java -cp hello.jar -Xshare:on \
         -XX:SharedArchiveFile=hello.jsa \
         Hello
```
   (3)
```
    java -cp alsonosuchfile.jar:hello.jar -Xshare:on \
         -XX:SharedArchiveFile=hello.jsa \
         Hello
```

In JDK 13 and earlier, only (1) is allowed while (2) and (3) would trigger an error.