JDK-6196163 : 'Invalid or corrupt jarfile' due to 1.5 backport
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 1.4.2_05
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2004-11-16
  • Updated: 2010-05-08
  • Resolved: 2006-01-31
Related Reports
Relates :  
Description
This is a duplicate of Sun Bug #4991229, with some additional explanation for 1.4.2_05.

The "Invalid or corrupt jarfile" message is being reported for certain jar files in 1.4.2_05 due to the backport of the parse_manifest code from 1.5 to 1.4.2_05.  (It also reproduces in _06, by the way.)

In our specific case, it appears to be related to the Main-Class entry, which refers to the main class within our jar.  We execute this code thusly...

java -jar foo.jar <arglist>

Here's the manifest...

Manifest-Version: 1.0
Created-By: 9.0.5.10.66 (Oracle Corporation)
Oracle-IDE-Name: Oracle Ojc
Oracle-IDE-Version: 9.0.5.10.66
Main-Class: oracle.ojc.frontend.Main

Unfortunately, there is no documentation explaining the change, or explaining why these manifest entries should be invalid.  Until the _05 backport, this worked just fine.  But because of the backport, the code in question no longer functions properly on _05 or _06, or on the Mac (which uses _05 currently).

Please provide documentation on your site explaining this change in the 1.4.2 code base, and explaining why people's jar files aren't valid any longer.  If you query "invalid or corrupt jarfile" on Google, you'll see a lot of hits for this.  A lot of people have been encountering it.
###@###.### 2004-11-16 20:32:08 GMT

Comments
EVALUATION It has been well over a year since this request was submitted and all efforts to obtain a copy of the offending jar file to diagnose the problem have failed. Oracle management gave us the option to close it if the jar file could not be obtained. Should the file be delivered, this request can be reopened.
31-01-2006