Sensitivity: A Case for Convention.
Image this. You develop a Java application that uses only standard Java features. It only uses a hand full of classes, so you just distribute individually. It works great until someone using windows runs your program.
“Why am I getting ‘Exception in thread “main” java.lang.NoClassDefFoundError: FOO (wrong name: Foo)’?”
Remember, Java is case sensitive, but the Windows file system is *not*.
public class Foo {
public static void main(String...args) {
new FOO();
}
}
class FOO {
public FOO() {
System.out.println("Works like a charm.");
}
}
When you compile this on Linux, you get “Foo.class” and “FOO.class”, but on Windows, you only get one file. Oops!
So, its always a good idea to follow good convention with regards to capitalization. Use CamelCase, and treat abbreviations as words. Use XmlParser rather than XMLParser. Note that some of the standard Java API doesn’t do that (URL for instance).
Tags: case sensitivity, cross-platform, portability, Windows sucks

January 28th, 2008 at 9:48 pm
Wow. This happened to me but in a worst-case-scenario. I was reviewing some old code, when I noticed a class which was called “concreteClass” (that is, the class’ name started with a non-capital letter). I refactored it for renaming (to “ConcreteClass”), it was successful, I checked it into SVN, and viola! Done.
Later on, when other people checked out that file, their local SVN client got stumbled on it - apparently, it didn’t DELETE the old file when I renamed it, so it tried to check out Both types of files (”concreteClass” AND “ConcreteClass”) and since they were using Windows computers it just didn’t work. Obviously it didn’t give a reasonable error to find why it was getting stuck but luckily we managed to deduce it was due to these two filenames with conflicting names under Windows (Our SVN repository is kept on a Unix machine so it had no problem keeping the files like that itself.)
Phew. Longer response than I thought it would be.
January 29th, 2008 at 9:23 am
I was actually going to mention the double-danger of this in CVS/SVN on windows. I have had issues changing the case of a file/directory changing (I develop on Linux) causing problems for others (who often use windows).
BTW. SVN uses bdb to store your files, so the names are OS independent (i.e. SVN server on Windows can still handle FOO and Foo).
The solution I found for this was to have the Windows users check out the whole module from scratch again.