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

How to write a code recursively and pass the value dynamically in java as shown below picture?
Quality issue when playing sound and fast fade-out in Java
Easiest way to convert a List to a ConcurrentSet? - Java [closed]
Not able to locate Element with same id
Thread safe way to invalidate session
Java method to recursively add each integer in an array to all of the elements following it?
Equivalent of Using #Autowired Interface in java [closed]
String Pool management
Trouble with Fragments in Android Studio
multiple queries java jdbc - read records simultaneously
Kettle, “NullPointerException” in Step: Java Script
Issue with redrawing ImageIcon across JPanel
How to pretty print a GumTreeDiff ITree?
Delete user inputted word in Java [closed]
Spring inject different bean depending on current scope
Switch statement for interface in Java

Categories

HOME
sendgrid
heroku
google-play
appx
vmware
getelementsbytagname
razor
rdf
survey
win32gui
umd
uber-api
session-variables
usergrid
uitypeeditor
opentracing
systemc
sms-gateway
plunker
reverse-proxy
paging
clickonce
scriptcs
facebook-access-token
minitab
xacml
msys2
libuv
librato
instant-messaging
nameservers
exuberant-ctags
siesta-swift
openoffice.org
android-kernel
geopositioning
wpf-controls
awt
hp-ux
jvm-languages
eigenvalue
heightmap
http-redirect
apple-news
cubic-spline
skeleton-css-boilerplate
azure-application-gateway
filepicker
jedis
qsslsocket
promela
jxcore
nodebb
windows-mobile-6.5
py2app
plottable.js
sdhc
collapse
wyam
sysinternals
event-bubbling
operation
apache-commons-net
directoryservices
relocation
mdt
wordpress-theme-customize
android-radiobutton
sgen
oam
aqtime
soundtouch
django-nonrel
random-seed
sqlperformance
eclipse-templates
oncheckedchanged
visitor-statistic
w3wp.exe
.nettiers
dmx512
gin
webkit.net





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