samskivert: Random bitching

07 July 2004

What kind of error message is this?

[11:20pm] baltic:~ > java -jar foo.jar
Exception in thread "main" No such file or directory
        at Method)
        at java.util.jar.JarFile.(
        at java.util.jar.JarFile.(

It doesn’t even tell me what file or directory is missing. You might think it’s obvious because I just ran the command, but frequently java is run from a shell script and all I see is this baffling crap about zip files.

I was about to suggest that it be more like the error message one gets when specifying a class that doesn’t exist:

[11:24pm] baltic:~ > java nonexistent.Class
Exception in thread "main" java.lang.NoClassDefFoundError: nonexistent/Class

However, that largely sucks as well. At least its not six calls deep into classloader code, which would be on par with the zip business, and it does tell me which class it couldn’t find, but it’s still a sorry excuse for an error message. Is it that difficult to catch the most common exceptions and report something sensible?

©1999–2015 Michael Bayne