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

Turning derby embedded database into derby network datatbase [duplicate]
Error when accessing a SQlite database in android studio
Why does the iterator print different output (related to failsafe)?
Dynamic association with multiple datasource JNDI entries with Spring
Calculate previous day using joda time [duplicate]
Overcome “Can not construct instance of InterfaceClass” without hinting the parent
How to compile ADF and JSF Utils and create the JAR files?
Simple AES encrypt in PHP, decrypt in Java
Batch Run does not capture the Exception in Console
Specify custom folder address in android app package
Cookie Error while getting OAuth Access Token from GitHub
Maven Build with Dependencies Jasper Reports [duplicate]
multiple jna project build path
How to package non-JavaFX application as Native installer with Maven
How to access the multiple choiceGroup in midlet class as selection
Why does this REST-service not return while the other does?

Categories

HOME
osgi
variables
keras
google-play
framework7
routes
google-oauth
jsrender
dxl
disassembler
indesign
uber-api
paradox
elasticsearch-hadoop
imacros
alignment
netflix
jqwidget
google-pagespeed
emulator
java-3d
errorlevel
claims-based-identity
greendao
applozic
log4js-node
msys2
tasklet
oracle-fusion-middleware
pdb
stringtemplate
protovis
language-concepts
ghost4j
nssegmentedcontrol
c11
particles.js
fedex
pdf-reactor
powershell-dsc
jvm-languages
node-gyp
midl
vao
websphere-mq-fte
togetherjs
yii2-extension
aurelia-validation
drupal-6
capacity
python-cryptography
pillow
cubes
radtreelist
url-masking
react-native-listview
actionbardrawertoggle
suffix-tree
browser-link
spim
prerequisites
cyclomatic-complexity
fouc
tarjans-algorithm
cakephp-3.1
sailfish-os
iiviewdeckcontroller
clipperlib
rake-task
offloading
cdt
terminfo
fluentautomation
system.net.webexception
tidy
jplaton
eclipse-memory-analyzer
sqlperformance
robotics-studio
anonymous-methods
typoscript2
path-separator
venn-diagram
chrono
boost-filesystem
spyware
android-sdk-2.1
infrastructure
gin
sustainable-pace
sector
gacutil
putchar

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