I am working verifying the jar files present on remote unix boxes with that of built on local machine(Windows & Cygwin) with same JVM.
As a POC I am trying to verify if same checksum is produced with jar files generated on my machine with consecutive builds, I tried below,
- Generated the jar file first time using ant script
- Calculated the checksum (e.g. "xyz abc")
- Generated the jar file again with same ant script without changing anything
- I got different checksum but same byte count (e.g. "xvw abc")
I am not sure how java internal processes produce the class files and then the jar files, Can someone please help me understand below points
- Does the
cksum
utility of unix/cygwin consider timestamp of the file while coming up with the value? - Will the checksum be different for compiled class files/jar file produced if we keep every other things same [Compiler version + sourcecode + machine + environment]?