public static Manifest getManifestWithMainClass ( Class < ? > klass ) { Manifest manifest = new Manifest ( ) ; manifest . getMainAttributes ( ) . put ( ManifestFields . MANIFEST_VERSION , "1.0" ) ; manifest . getMainAttributes ( ) . put ( ManifestFields . MAIN_CLASS , klass . getName ( ) ) ; return manifest ; }
Given a class generates a manifest file with main - class as class .