« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today
XML

Blog::Navigation

GetJava Download Button
Get the Source
Personal Blog

Blog::Referers

Today's Page Hits: 72

Powered by Roller Weblogger.
« More JavaScript... | Main | Recent changes in... »
20060712 Wednesday July 12, 2006

Bitten by whitespace

I was making a jar file for testing something. I had given a manifest file and a set of classes by the following command line:


    jar cvfm myjar.jar mymanifest.mf *.class

When I used myjar.jar, the manifest entries I specified in my mymanifest.mf were not working as expected. I opened the jar and checked the added manifest.mf in the jar file -- it did not have attributes defined in mymanifest.mf in it! In fact, my manifest.mf had just one attribute!! It turned out that I was bitten by whitespace -- newline was missing at the end of the attribute. Apparently, manifest file spec. mandates newline at the end of attributes. jar tool did not complain about my manifest file :-( Moral of the story: beware of whitespaces!



( Jul 12 2006, 04:51:34 PM IST ) Permalink Comments [1] del.icio.us | furl | simpy | slashdot | technorati | digg

Comments:

Indeed! And always trim() your filenames before using them anywhere or you'll also spend some happy hours trying to locate a bug, like me: http://jroller.com/page/murphee/20060620

Posted by murphee on July 12, 2006 at 05:42 PM IST #

Post a Comment:

Comments are closed for this entry.
Copyright (C) 2005, A. Sundararajan's Weblog