JDK-8202223 : Document UseAppCDS change in JDK 11
  • Type: Sub-task
  • Component: docs
  • Sub-Component: tools
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-04-24
  • Updated: 2018-08-10
  • Resolved: 2018-08-10
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 11
11Fixed
Description
- The UseAppCDS flag is obsolete in JDK 11. The support for archiving and sharing non-system classes is enabled automatically if application classes or platform classes present in the classlist and generated shared archive with -Xshare:dump/auto/on.

CDS/AppCDS supports archiving classes from JAR files only. Non-empty directory is reported as an fatal error:
 * For base CDS, non-empty directory cannot exist in -Xbootclasspath/a path 
 * With -XX:+UseAppCDS, non-empty directory cannot exist in -Xbootclasspath/a path, class path, and module path 

The handling for non-empty directory is backwards compatible in JDK 11 after making UseAppCDS obsolete. The behavior will be based on the class types in the classlist: 
 * If no application classes or platform classes are loaded, dump time only reports error if non-empty directory exists in -Xbootclasspath/a path 
 * If application classes or platform classes are loaded, dump time reports error for non-empty directory exists in -Xbootclasspath/a path, class path, or module path 

- In JDK 11, using -XX:DumpLoadedClassList=<class_list_file> results a generated classlist with all classes (both system library classes and application classes) included. It is no longer needed to specify -XX:+UseAppCDS with -XX:DumpLoadedClassList in order to produce a complete class list.

- SharedArchiveFile is a product flag in JDK 11.