Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 211613

Summary: [jarprocessor] JarProcessor does not maintain backward Java 1.5 compatibility
Product: [Eclipse Project] Equinox Reporter: Thomas Hallgren <thomas>
Component: p2Assignee: P2 Inbox <equinox.p2-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, david_williams, mistria, nboldt, pascal
Version: 3.4Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 179315    

Description Thomas Hallgren CLA 2007-11-30 12:27:21 EST
The API documentation for Pack200 used by the JarProcessor states the following:

"In order to maintain backward compatibility, if the input JAR-files are solely comprised of 1.5 (or lesser) classfiles, a 1.5 compatible pack file is produced. Otherwise a 1.6 compatible pack200 file is produced."

All fine and well. The problem occurs when the JAR-file contains zero classfiles. When that happens, the pack200 doesn't see any reason to maintain backward compatibility and hence, will produce a packed file that, when unpacked from a Java 1.5 environment, will produce the following error:

Stack Trace:
java.io.IOException: Corrupted pack file: magic/ver = CAFED00D/160.1
should be CAFED00D/150.7

 at com.sun.java.util.jar.pack.NativeUnpack.start(Native Method)
 at com.sun.java.util.jar.pack.NativeUnpack.run(Unknown Source)

A good example is the file org.eclipse.swt_3.3.2.v3347.jar

I think it would be great if the JarProcessor would recognize this fact and refrain from packaging jar files that contains no class files.
Comment 1 David Williams CLA 2007-11-30 14:22:23 EST
As a work around, I think org.eclipse.swt could be "marked" as "do not pack"? 
(in the eclipse.inf, if I recall?). 

Comment 2 John Arthorne CLA 2007-11-30 15:13:37 EST
There are many bundles that contain no class files. You'd think pack200 would only generate in the new format if a Java 6 class is present... 
Comment 3 Mickael Istria CLA 2019-03-21 05:33:05 EDT
Java 8 is the minimal supported version by Eclipse Platform and p2 now.