The Three Rules for Debugging Your Java Environment

It has been a while since I was an every-day-all-day Java developer and since that time (vi on Solaris or HP-UX) tools like Eclipse have made the Java environment greatly simplified. However, just this week I was reminded that, even in this easier world, there are three rules I came up with way back then that still apply when you are debugging a ClassNotFound or other sort of environmental error:

  1. It’s your classpath. Go through your path a character at a time if you have to.
  2. It’s permissions. You don’t have read or write access to something. Look through every line of code that accesses a resource and validate that you have the proper permissions to get to it.
  3. It isn’t permissions? Sorry, it really is your classpath. Go back to rule 1!