Search code examples
javajarmanifest.mf

reading MANIFEST.MF file from jar file using JAVA


Is there any way I can read the content of a jar file. I want to read the manifest file in order to find the creator of the jar file and version. Is there any way to achieve it?


Solution

  • Next code should help:

    JarInputStream jarStream = new JarInputStream(stream);
    Manifest mf = jarStream.getManifest();
    

    Exception handling is left for you :)