Community
Participate
Working Groups
Build Identifier: 3.5.1 I have a problem by retrieving data about files within eclipse-generated jar-file. ZipEntry::getCompressedSize() and ZipEntry::getCrc() do no return appropriate values. It seems data is stored in an extended local header. I believe API for reading compressed data should be published since Eclipse is an open source project... Reproducible: Always Steps to Reproduce: 1.Select the java project 2.Export -> Java -> Runnable Java file 3.Read the content via the java's ZipEntry: CRC and Size aren't retrieved. At the same time WinZip shows the proper values.
Oleg, Why is this assigned to PDE Build? Shouldn't this go to JDT UI?
Ops, you are right: the dialog is FatJarPackageWizard (from org.eclipse.jdt.internal.ui.jarpackagerfat), uses UnpackFatJarBuilder (from org.eclipse.jdt.internal.ui.jarpackagerfat)
Can you please explain what you try to do?
(In reply to comment #3) > Can you please explain what you try to do? I should show the content of jar-file to the user of my java application: file name, CRC, size etc. In eclipse-generated jar-files some data is stored in extended local header instead of basic header and ZipEntry cannot retrieve it. I need to know structure of extended header of jar-file for parsing the return value of ZipEntry::getExtra() to get size and CRC values.
I digged into the problem. Since the extra field is not used in JarWriter4.java, it seems jar-files are creating incomplete or including incompatible data. What version of Java is used for building Eclipse?
Using 3.7 M4 with Oracle 1.6 JRE I added public class Test { public static void main(String[] args) { } } and exported it as 'JAR file' and as 'Runnable JAR file'. Both created JARs have the CRC and compressed size information when looking at the included files e.g. via WinZip.
The issue is caused by a bug in java.util.zip.ZipInputStream: ZipEntry items are creating incomplete. The same jar-file is reading fine by java.util.zip.ZipFile.
(In reply to comment #7) Thanks for the feedback. Please file a bug against your JDK.
The bug report #7015881 was opened in Oracle Bug Database. It's still hidden due to "security reasons".