Skip to content

Instantly share code, notes, and snippets.

@liviutudor
Created November 21, 2019 07:41
Show Gist options
  • Select an option

  • Save liviutudor/cf401cdb44eaf534c10d08266a351048 to your computer and use it in GitHub Desktop.

Select an option

Save liviutudor/cf401cdb44eaf534c10d08266a351048 to your computer and use it in GitHub Desktop.

Revisions

  1. liviutudor created this gist Nov 21, 2019.
    5 changes: 5 additions & 0 deletions ReadJarManifest.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    URLClassLoader cl = (URLClassLoader) App.class.getClassLoader();
    URL url = cl.findResource("META-INF/MANIFEST.MF");
    Manifest manifest = new Manifest(url.openStream());
    Attributes attr = manifest.getMainAttributes());
    System.out.println(manifest.getMainAttributes().getValue("Implementation-Title"));