The evils of /usr/share/java/repository
I've just spent hours trying to figure out why a SAX1 class was being picked up
by Tomcat, and used instead of my SAX2 class.
It turns out that the 'java' script of j2sdk1.3 sneakily adds
/usr/share/java/repository to the classpath, and I had, for reasons long
forgotten, installed 'lib-sax-java'.
Now actually, this is the second draft of this email. The first had the subject
"Aargh.. which FIEND invented /usr/share/java/repository??", used many
expletives, and questioned the competence and sanity of the Java Policy authors.
But I'll spare you that ranting; let's just say I think it's a horrifically bad
idea to have a free-for-all in one's classpath. Developer communities gradually
gain experience, and if the Java community has learned anything, it's that
**classpaths are evil**. This is *worse* than a hardcoded classpath, because
it's not even visible to users!
I can see one counterargument; I should have installed Tomcat from a .deb,
which would have noticed the conflict. This argument only holds for *users*. I
am a *developer*, usually working with stuff from CVS. Even for users, 99% of
Java programs out there are not debianized.
Conclusion: Debian is a Java developer-hostile operating system. No Java
developer can use Debian's packaged Java apps without risk of unsolvable (for
non-root) classpath conflicts. I have since uninstalled every Java package I