The Destiny of a Manifest

A few weeks ago, while working on a personal project, I scraped together a simple utility from a few examples on the web. The problem I’m interested in is reading my application’s MANIFEST.MF ’cause that file is often used to hold interesting information (such as version numbers and authors).

Suppose I want to construct a help page/window, and I want to include information about what version of the application is in use. I could put that information in a properties file somewhere, but there’s often duplicated information in my MANIFEST.MF.

It’s hard to read the MANIFEST.MF in an environment where there are many .jars in the classpath. Reading it in as a resource usually picks the first MANIFEST.MF that the classloader found (often one from the JRE). This code snippet was inspired by a few sources: