My contemplations and diurnal novelties are publicized here

Following is the piece of code to get your executing Jar name and its modified date. You can use these info for logging purpose:-

// Get File Jar File

String jarFileName = new;

JarFile jf = new JarFile(jarFileName);

// Get Manifest

ZipEntry manifest = jf.getEntry(“META-INF/MANIFEST.MF”);

// Get Manifest date time

long manifestTime = manifest.getTime();

Date date = new Date(manifestTime );

DateFormat formatter = new SimpleDateFormat(“YYYY-MM-dd HH:mm:ss:SSS”);

String dateFormatted = formatter.format(date);    “Executing Jar :” + jarFileName + ” with modified date: “ + dateFormatted);


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: