At 15:35 01 Jan 2001 -0500, Michael Thome wrote:

> Does anyone have a good binfmt_misc recipe for making "executable
> jar files" runable?  What I'm actually looking for in one which 
> doesn't depend on a ".jar" extension, but this requires being able to
> tell the difference between an executable jar file and any other type
> of zip file in the first 128 bytes... is this possible?  My gut
> reaction is that trying to execute all zip files with x bits set is
> probably too broad.

The difference between an executable .jar and an normal .jar or .zip is the
addition of a META-INF/manifest file that contains, as one of it's lines
"Main-Class: com.company.blah.Main".

A jar file has a directory with all the filenames in it (and appropriate
offsets).  But the manifest file could (presumably, I'm not sure about this)
even be compressed.

I would recommend relying upon the .jar extension, and, if you're paranoid,
verifying that it's in the format of a .zip file.  I'm pretty sure you can't
make any guarantees about the first 128 bytes and executable jar files.

- Paul

-- 
Paul Mclachlan ([EMAIL PROTECTED])
Software Engineer, Java Tools.  NuMega Lab, Compuware corp.


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to