If the Java program you run has a dependency on the system environment variables having a classpath that is set to a specific Java SDK directory the way TextPad does, you will encounter compilation errors if the classpath is not set properly. This can occur if the system environment variables don't contain a classpath at all.
- To check the classpath on a Windows XP computer, you can type in "echo %classpath%" under command prompt. For example, in the output "c:\jdk1.5.0_04;.", the period represents that the current directory is in the class path.
- Another method to check the classpath: Choose Start | Settings | Control Panel | double-click System. Select the advanced tab and then Environment Variables. Look for "Classpath" under the system Variables.
- If the classpath does not exist, or if the classpath does not look similar to this:"C:\Program Files\jdk 1.5.0_6\lib;C:\Program Files\Java\jdk 1.5.0_6\bin;.;C:\Program Files\Java\jre 1.5.0_6\QTJava.zip", open TextPad and choose "Configure | Preferences | Tools | Compile Java". Then change the Parameters by entering "-cp . $File" in the box. This will eliminate the need for the classpath to be set on the system.
- Compile Java file again.