Once we know which classes are loaded, we can create our AppCDS archive. Here are the command line and flag options to use:
java -Xshare:dump -XX:+UseApsCDS \ -XX:SharedClassListFile=ch2.lst \ -XX:SharedArchiveFile=ch2.jsa -cp ch2.jar