commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: [compress] A few comments
Date Wed, 18 Jun 2008 09:19:11 GMT
On Wed, 18 Jun 2008, Emmanuel Bourg <ebourg@apache.org> 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: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message