During CDS dump time, it would not record an entry in the classpath which is not a jar file.
e.g. -cp A.jar:B.jar
If A.jar is not a jar file, CDS only records B.jar in the archive.
During runtime, if the same -cp is specified. Both A.jar and B.jar will be used for comparing with the shared classpath in the archive. This resulting in class paths mismatch and the archive will not be used. It is because during runtime, it only checks if the file exists. It should check if a file is a jar file in the classpath, as is being done during dump time, and ignore the entry if it isn't a jar file.
e.g. -cp A.jar:B.jar
If A.jar is not a jar file, CDS only records B.jar in the archive.
During runtime, if the same -cp is specified. Both A.jar and B.jar will be used for comparing with the shared classpath in the archive. This resulting in class paths mismatch and the archive will not be used. It is because during runtime, it only checks if the file exists. It should check if a file is a jar file in the classpath, as is being done during dump time, and ignore the entry if it isn't a jar file.