Hi All,
I'm having trouble using Archive::Zip to write a file that is then readable by the jar program (Sun JDK 1.5.0_10).
I want to take a JAR created elsewhere and modify a file inside it with perl an write it back out. However, after modification and writing out with Archive::Zip, the jar program gives an error when reading the contents. Here are the stripped down steps:
** This gives no errors or warnings.**use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); my $az_foo = Archive::Zip->new('foo.jar'); unless ($az_foo->writeToFileNamed('bar.jar') == AZ_OK ) { die 'write error'; } my $az_bar = Archive::Zip->new(); unless ( $az_bar->read('bar.jar') == AZ_OK ) { die 'bad bar bad!' }
java.util.zip.ZipException: only DEFLATED entries can have EXT descrip +tor at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:250) at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:7 +3) at sun.tools.jar.Main.list(Main.java:735) at sun.tools.jar.Main.run(Main.java:191) at sun.tools.jar.Main.main(Main.java:903)
It seems to me the 'META-INF/' directory member is actually expected to be deflated by the jar program - doesn't make sense. I thought I'd ask those wiser than myself before contacting the owner on this one...maybe there is something simple I can do. Cheers and beers.
20070813 Janitored by Corion: Changed PRE tags to P tags, as per Writeup Formatting Tips
In reply to Archive::Zip Problem: Zip versus Jar file formats by sblanton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |