posted 19 years ago
Your settings are not correct.
JAVA_HOME should refer to the directory containing the "bin" directory that contains the Java executables "java" and "javac".
JAVA_HOME/bin should be in the PATH so that the operating system can locate the "java" and "javac" executables.
The CLASSPATH is used to locate Java class files (and other resources) needed at compile time and at run time. I don't recommend including JAVA_HOME or JAVA_HOME\bin in your CLASSPATH, because I don't recommend keeping your compiled Java class files in either of these locations. In fact, I recommend not setting the CLASSPATH at all. Unless you're getting into using third party libraries or resources from multiple locations, it's not necessary to have the CLASSPATH set, as the JRE and the Java compiler will automatically find resources in the current working directory. If you are going to set the CLASSPATH, the JRE and the Java compiler will not automatically find resources in the current working directory, and you'll likely want to be sure to include the current working directory, as specified by a period.
In review, if you installed the J2SDK in the "C:\Program Files\Java\jdk1.5.0" directory, I recommend the following settings for your JAVA_HOME, PATH and CLASSPATH environment variables. (Don't forget the quotes since you're using a directory name with a space in it.)
JAVA_HOME="C:\Program Files\Java\jdk1.5.0"
PATH=JAVA_HOME\bin;(Whatever else your system wants.)
Don't set the CLASSPATH. If you must, then include the current working directory, as specified by a period.
CLASSPATH=.;(Whatever else you want.)