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

EntityManager is null with XMLless JPA 2.1
IDEA +tomcat, won't update the changes on javaFile when tomcat was restarted
Proper Http status codes for uploading files on rest end point
Firebase reading issue. Object always null
Jackson error com.fasterxml.jackson.databind.ser.ContainerSerializer: method <init>(Lcom/fasterxml/jackson/databind/JavaType;)V not found
Hibernate session.createQuery().getResultList() returns null
put data to hashmap without overwrite
How to create RecordN for generated DAO lookup
Java 8: Map instead of simple loop
Detecting when an integer is made up of only the same digit
How to default an EditText to integer but allow decimal input?
Prime numbers no loop no recursive
JMX polling or TCP Pushing: What is better?
how can I stop the execution of the while loop with a keyboard input?
Profile neo4j database hits using java
Big O notation and not understading from class lecture

Categories

HOME
blogger
activiti
stock
vmware
sd-card
sqlite3
sql-server-2016
callback
opengl-es-2.0
node-notifier
applepay
row
commonmark
ibm-odm
carthage
designer
windows-7-x64
evopdf
oxyplot
openedx
nas
swiftlint
facebook-instant-articles
tapestry
devops
chromebook
uninstall
webkitspeechrecognition
gsmcomm
data-manipulation
caret
occlusion
ssjs
sqlite2
impersonation
leading-zero
avro4s
python-webbrowser
jlink
veracode
android-cursor
media-player
qtwebview
minimization
angular-strap
url-pattern
android-fonts
xml-attribute
fuzzy-search
holder.js
blackberry-10
testng-dataprovider
itextpdf
marching-cubes
metaclass
retina
wyam
tableau-online
processmodel
dundas
ng-animate
qpainter
gui-test-framework
android-nested-fragment
castle
tld
phpthumb
valueconverter
bundles
typo3-neos
intentservice
terminal-services
gridfs
gwt-rpc
html4
mylyn
eventlistener
mhtml
libstdc++
quickdialog
coderush
gdata-api
onsubmit
tomcat-valve
recent-documents
lpeg
cxxtest
google-friend-connect
jquery-ui-droppable
user-friendly
mdac
grid-system

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