java


Why does the same JAR file have different hash every time I build it?


I've been thinking about checking jar file's hash value to determine if it has changed or not, but as it turns out the same jar file has different hashes every time I build it (export as jar file from eclipse, or build it using maven). I've removed manifest file's date values and stuff but it still is different. Is there something in bytecode generation which includes a timestamp or something?
A JAR file is a ZIP file and it contains a last modified date in its local file headers and central directory file header. This will lead to different hashes of your builds.
If you run the JAR command on the exact same set of files (with same file dates) and skip manifest file creation it should give you the exact same JAR file (if the order of files inside the ZIP does not change).

Related Links

Java won't print output
Incorrect output while using Stanford CoreNLP Sentiment Analysis
how to get Client system Ip Address in Serverlet request [duplicate]
How can I get all columns for a specific row from the database to another layout?
Java: JOptionPane Input
How would I find the max value of objects in ArrayList in for-loop? -Java [closed]
Testing if elements in an array are equal regardless of order or frequency
Adding a Typeclass to Java enum - without simulacrum
WebSocketClient in java / jetty, cause error 'Didn't switch protocols'
Spring annotation validation and indexing for nested objects
How to remove from generic doubly linked list
Gradle build can't find method
WARN PageNotFound:No mapping found for HTTP request with URI
Why doesn't the Java Installer set the environment variable PATH automatically? [duplicate]
Apache cxf soap java client throwing connection reset exception with java 8. Works with 7 though
Trouble with deploying Spring boot project on Heroku

Categories

HOME
activiti
mediawiki
deezer
fluentd
heroku
include
elm
react-redux
spring-jdbc
jsrender
retrofit
ojdbc
ezpublish
convolution
medical
etl
gz
undefined
conemu
restful-authentication
icloud-api
android-widget
traffic
libssl
tasklet
microsoft-chart-controls
.net-4.0
pdb
protovis
google-api-nodejs-client
normal-distribution
revolution-slider
qwerty
web-mining
c11
theano.scan
hp-ux
grid.mvc
botbuilder
reactive-cocoa-5
qcombobox
logfiles
long-polling
jsch
qsslsocket
dandelion
pg-dump
windows-mobile-6.5
knpmenubundle
linode
iso8601
mongocsharpdriver
dlna
spim
jmeter-maven-plugin
pundit
varargs
xcode-6.2
device-manager
phpthumb
valuechangelistener
imdbpy
multiprocessor
oam
cdc
flash-builder4.5
shellexecute
referrer
browser-detection
dice
online-compilation
netbeans-6.9
cufon
boost-filesystem
heartbeat
locationlistener
javax.script
calling-convention
xfbml
remember-me
gamequery
gin
xsdobjectgen
ext3
iweb
eqatec
grid-system
data-acquisition
rtml

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App