When a compiler attempts an import, and it cannot resolve the classes with the libraries it inherently knows about (the standard
java api libraries) it uses the 'class finding path', or 'classpath' to attempt a resolution of the import.
So for the import: if you have x.y.z, it turns that into x/y/z (or x\y\z) and prepends each entry in the classpath, until it can find the class.
I'm not very familiar with the JSP compiler and how it goes about resolving classes...
JAVA_HOME is (I think) only used by the startup scripts for Tomcat, so the jsp compiler may not use this variable at all.
Setting environment variables is quite different for each operating system, so however you set JAVA_HOME... that's the same way to change your CLASSPATH.
In Win9x, it's in autoexec.bat
In WinNT, it's right-click My Computer, Properties, Environment
In Win2k, it's right-click My Computer, Properties, Advanced, Environment Variables
In any UNIX type system, it's in a startup script somewhere.
As a side note, my system does not have a CLASSPATH variable at all, and I can get JSP imports to work. This is not a recommendation to blow away your CLASSPATH variable! Other programs may need it. But because I also use JBuilder (which sends CLASSPATH to javac as a parameter), I don't need a system CLASSPATH.
It seems that if it's present, the jsp compiler will use CLASSPATH, but if it's not present, it looks in JAVA_HOME? I'm really not too sure what steps the jsp compiler takes to find classes.
Try this: look at your PATH variable. In my path variable, I have d:\jdk131\bin
This means that anything that calls 'javac' will use the jdk1.3.1 compiler... because this compiler 'knows' where to find java.util.ArrayList without the help of CLASSPATH, perhaps that might solve the problem?
[This message has been edited by Mike Curwen (edited September 19, 2001).]