After reading this blog about classpaths and how difficult they are, I remembered one thing about classpaths that really irritates me.
I have taught Java for about 5 years now. The one thing that I teach which brings value to the students is classpath. I spend about 4-5 hours just on classpath alone. I discuss what it is, how it is setup, what is the best way to set it up, what a classloader is, what a jar file is, etc. This topic alone is very difficult for beginners to understand, and unfortunately it has to be one of the first things that I teach. It is amazing that when you look at all the different java books out there, no book has information about what a classpath is. Thinking in Java doesn't have anything, Learning Java doesn't have anything, Head Start Java doesn't have anything, Dietel's How to Program in Java doesn't have anything, Complete Java 2 Certification has nothing, Java by Example has nothing either. It is absolutely astonishing that books, targeted for learners do not have this critical piece of information.

Sat, 8 Oct 2005 12:52 PM GMT
I agree that classpaths are painful, and I always get stuck having to deal with them.
First, I was documenting how to set them from the command-line, and showing people how to set them in their profiles.
Then I started setting them in manifest files.
And now I deal with them in Ant.
Ant is by far the easiest way to handle this aspect of development, and it's more understandable than the other ways. If I were teaching someone how to deal with classpaths, I'd have them read a book on Ant (probably "Ant in Action" --- some Java books may talk a little bit about classpaths, but they don't do a very good job of showing how integrate them into development.
Even with Ant, classpaths are still a pain.