When the modules file used at run time differs in size from the one used at build time, the warning is confusing:
$ .../bin/java -jar .../demo/jfc/Notepad/Notepad.jar
[0.033s][warning][cds] A jar file is not the one used while building the shared archive file: /.../lib/modules
[0.033s][warning][cds] A jar file is not the one used while building the shared archive file: /.../lib/modules
[0.033s][warning][cds] /.../lib/modules timestamp has changed.
First, it refers to the file as a "jar file", which it is not. Also, it complaints about the timestamp, while actually the reason for the warning is the difference in size.
To reproduce:
1. build a JDK image with --enable-cds
2. build or download a different version of a JDK image
3. replace the .../lib/modules file in the first with the corresponding file from the second, making sure they differ in size
4. run any Java app using java from the first image
5. observe the warning
$ .../bin/java -jar .../demo/jfc/Notepad/Notepad.jar
[0.033s][warning][cds] A jar file is not the one used while building the shared archive file: /.../lib/modules
[0.033s][warning][cds] A jar file is not the one used while building the shared archive file: /.../lib/modules
[0.033s][warning][cds] /.../lib/modules timestamp has changed.
First, it refers to the file as a "jar file", which it is not. Also, it complaints about the timestamp, while actually the reason for the warning is the difference in size.
To reproduce:
1. build a JDK image with --enable-cds
2. build or download a different version of a JDK image
3. replace the .../lib/modules file in the first with the corresponding file from the second, making sure they differ in size
4. run any Java app using java from the first image
5. observe the warning
- relates to
-
JDK-8284313 Improve warning messages when CDS archive fails to load
-
- Resolved
-