The concept of the CLASSPATH has been with us since the beginning. The concept of the Jar file has also been with us for some time now, although I still remember the time when it was introduced in JDK 1.1.
I've always felt that there is something wrong with both concepts, but couldn't pin it down.
Today I had an A-ha moment: The way Java's going about putting classes into a CLASSPATH is just silly. We should be using something like a JARPATH, not CLASSPATH.
The Java class file is no longer the unit of distribution of modern Java systems. We deliver our systems as a set of Jar files. Yet we insist on maintaining a CLASSPATH.
This is the wrong level of granularity.
We sort of already have a solution for this problem in the context of web apps with its WEB-INF/lib directory. We also can use the JRE extension mechanism whereby you can put a jar file into the $JRE_HOME/lib/ext.
But can't we persuade Sun to introduce a JARPATH environment variable? So that instead of doing: