Friday, February 25, 2005

Blind as Blind Can Be

I have just spent a couple of days trying to make my JAR builder work.


The resulting JAR file failed to be readable by anything. So I unzip it(using WinZip) and change the manifest to something nice, re zip it and it works.


Back to the code, fix the manifest builder, re-run the code.


The resulting JAR file still fails to be readable by anything. So I unzip it, compare the new manifest with the manifest in jdom.jar, make changes, re zip it and it works.


Back to the code, fix the manifest builder, re-run the code.


The resulting JAR file still fails to be readable by anything. So I unzip it, do nothing, re zip it and it works.


So it's some setting or other.


Look for available settings in JarEntry, JarOutputStream et al.


Nothing helps me.


Open pre and post winzip jar files in ultra edit.


Notice extra character in zip entry at the beginning of the file name.


Fix code, re-run, still fails.


By this time I am annoyed, angry, looking for info about bugs in JarOutputStream etc.


Deep breath, try again. Open both pre and post winzip jar files, stare for about ten minutes. Sees it


Fix code, it works.


Note to self, remember which slash works.


Code was :


String act = file.getPath().substring( top.getPath().length() + 1 );

Code is :

String act = file.getPath().substring( top.getPath().length() + 1 ).replace( File.separatorChar, '/');

Two days of frustration. I blame C/CPM and Microsoft.

0 Comments:

Post a Comment

<< Home