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

Exporting source images for JAR
Tween engine - Tween.to ignores target value
Can't figured out the error of this RandomAccessFile code in Java
GCM multiple line Notification
transformClassesAndResourcesWithProguardForRelease' error in Android
Facing some errors on running 'Hello world' android app from Eclipse
Java - handling collision
Why detecting FaceDetector no faces?
Multiple queues in same Module with only one connection factory in weblogic and spring JMS template
Java - get top 15 from HashMap by rule
Securing RESTful Web Services Using Java Security Annotations
How to release resources in Spring bean? [duplicate]
Springboot /gradle/tomcat: Process java.exe finished with non-zero exit value 1
Is there any difference between “.andReturn(…).anyTimes()” and “.andStubReturn(…)” in EasyMock?
It is possible change color of selection in TabHost?
Xml to JSON Single Valued Array handling

Categories

HOME
deployment
blogger
proxy
google-api-php-client
vmware
objectgears
jira
sharepoint-designer
jxls
indesign
uber-api
offline
dax
vb.net-2010
footer
reactive-cocoa
http-status-code-504
tibco-mdm
format-specifiers
php-openssl
claims-based-identity
blazemeter
shopware
fgetcsv
social-media
fifo
elasticsearch-net
ejabberd-module
atlassian-crucible
windowbuilder
.net-4.0
uisplitview
functor
exuberant-ctags
usbserial
hybridauth
textmate
mozilla
amazon-kinesis-kpl
android-browser
az-application-insights
ruby-on-rails-3.1
texmaker
fakeiteasy
bootstrap-dialog
modelmapper
dotcover
hendrix
clean-architecture
dropbox-php
mu
togetherjs
git-diff
yii2-extension
forever
jspdf-autotable
bind9
webdriverjs
specrun
nxt
vmware-tools
simplewebrtc
actionbardrawertoggle
qgraphicsview
python-stackless
tform
cloudbees
tcpserver
spim
maven-tomcat-plugin
jmeter-maven-plugin
libressl
android-nested-fragment
elliptic-curve
hippomocks
industrial
farseer
cdc
flash-builder4.5
shellexecute
padarn
jquery-mobile-dialog
xamlparseexception
robotics-studio
mhtml
cascalog
dotnethighcharts
ohm
pydot
external-accessory
vdsp
cinema-4d
pyinotify
infrastructure
filtered-index
nsviewanimation
microsoft-virtualization
post-build
commodore

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