atom feed4 messages in net.java.openjdk.bsd-port-devunhappy jar binary
FromSent OnAttachments
S.P.ZeidlerMay 2, 2009 1:58 pm 
Martin BuchholzMay 3, 2009 6:19 pm 
S.P.ZeidlerMay 4, 2009 12:19 am 
Kurt MillerMay 12, 2009 6:16 am 
Subject:unhappy jar binary
From:S.P.Zeidler (sp@serpens.de)
Date:May 2, 2009 1:58:39 pm
List:net.java.openjdk.bsd-port-dev

Hi,

compiling bsd-port with openjdk7 results in a jar binary that does eg: % /usr/local/bsd-port/build/bsd-amd64/j2sdk-image/bin/jar xf rt-closed.jar @foo java.lang.NullPointerException at java.lang.String.startsWith(String.java:1433) at java.lang.String.startsWith(String.java:1462) at sun.tools.jar.Main.extractFile(Main.java:879) at sun.tools.jar.Main.extract(Main.java:860) at sun.tools.jar.Main.run(Main.java:245) at sun.tools.jar.Main.main(Main.java:1133)

This is due to the new extract method not setting cwd, which makes the bsd-port extractFile patently unhappy. If one adds: --- snip --- --- a/src/share/classes/sun/tools/jar/Main.java Tue Mar 10 09:04:32 2009 -0700 +++ b/src/share/classes/sun/tools/jar/Main.java Sat May 02 17:50:29 2009 +0000 @@ -845,6 +845,17 @@ * Extracts specified entries from JAR file, via ZipFile. */ void extract(String fname, String files[]) throws IOException { + // Current working directory + + cwd = System.getProperty("user.dir"); + if (cwd == null) { + fatalError(getMsg("error.no.cwd")); + } + cwd = (new File(cwd)).getCanonicalPath(); + if (!cwd.endsWith(File.separator)) { + cwd += File.separator; + } + ZipFile zf = new ZipFile(fname); Set<ZipEntry> dirs = newDirSet(); Enumeration<? extends ZipEntry> zes = zf.entries();

--- snip --- all is well (tm).

best regards, spz