On Wed, 18 Jun 2008, Emmanuel Bourg <[EMAIL PROTECTED]> wrote: > Stefan Bodewig a écrit : > >> On Solaris a file with the extension .jar whose first ZIP extra >> field has the ID 0xCAFE (and is otherwise empty) is considered >> executable and automatically handed of to Java as a "shell". >> >> The jar tool in Sun's JDK adds this extra field and so does Ant's >> jar task. > > Is it only added if the manifest has a Main-Class attribute ?
Not sure what the jar CLI tool does, but Ant always adds it (I just looked into the code). It has to be the first extra field of the directory entry of META-INF/ - which in turn has to be the very first entry IIRC. <https://issues.apache.org/bugzilla/show_bug.cgi?id=32649> confirms that. If you try it on a jar without a main class you'll get the exact same effect as running java -jar manually. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]