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 Generics Type Inference Confusion
Cancel RxJava Observable
Appium 1.6: An unknown server-side error occurred while processing the command during click and sendKey
How to decompress zlib
nested exception is java.lang.NoSuchMethodError: io.grpc.protobuf.ProtoUtils.marshaller(Lcom/google/protobuf/Message;)
Multiple Choice Randomization
MS Edge showing file origin as “about:blob”
JAVA REGEX:Make nested same values into single group
Using JScrollpane with the drawline() method
Android-show keyboard above popupmenu
Any way to give variable 2 types?
ClassNotFoundException MySql JDBC connector error only if entire project is run
Writing Enums to a File Using DataOutputStream
JavaFX load exception while create choiceBox
I am trying to inherit java class from servlet
Recommended values for jdk.certpath.disabledAlgorithms & jdk.tls.disabledAlgorithms?

Categories

HOME
netsuite
drivers
getelementsbytagname
react-redux
c#-2.0
fsm
ebean
pivotal-cloud-foundry
wamp
paradox
add
kibana-4
correlation
windows-phone-7
size
dtrace
dynamics-crm-online
oracle-coherence
viewport
restful-authentication
fifo
fluentvalidation
strncpy
assistant
dbclient
libuv
windowbuilder
google-rich-snippets
phonegap
http-status-code-503
create-table
google-sites-2016
caret
hexo
nssegmentedcontrol
http-digest
overlap
appfabric
retina-display
jna
splice
quadratic-programming
google-closure
jvm-languages
firebase-admin
estimote
turbogears
galleria
filepicker
svmlight
drupal-6
carrot
nodebb
mediaelement
messenger
visual-c++-2008
phishing
mongocsharpdriver
plottable.js
multiple-regression
hill-climbing
reactive-banana
google-places
quicklisp
dukescript
varargs
responsive-images
jsapi
gadt
openexr
contenttype
oracle-warehouse-builder
ccss
aqtime
easy-install
hungarian-algorithm
seed
angularjs-controller
nsmanagedobject
pendrive
invite
javax.script
pyinotify
sql-server-profiler
remember-me
site.master
cxxtest
asp.net-profiles
zend-tool
pascal-fc

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