java installed to: c:\j2sdk1.4.1_02 I want to be able to run java programs on an e: drive, but I get the following error: Exception in thread "main" java.lang.NoClassDefFoundError: TestMail I can compile a program for example in the e:\startup folder by typing: c:\j2sdk1.4.1_02\bin\javac TestMail.java from the e:startup folder However when I go to run this program by typing: c:\j2sdk1.4.1_02\bin\javac TestMail , I get the above error. Now my envirnoment variable setting are: Path %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Symantec\pcAnywhere\;C:\j2sdk1.4.1_02\bin; CLASSPATH: %JAVA_HOME%\lib\tools.jar JAVA_HOME: c:\j2sdk1.4.1_02
I would like to be able to compile and run java programs from anywhere on my system. How would I set the classpath to allows this?
Listing on the imports on the testmail program: import java.sql.*; import java.text.*; import java.util.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; import java.net.InetAddress; import java.net.*; public class TestMail Any help would be great. thanks! Dean
Thankyou every for your responses. I did add the "." to the CLASSPATH variable and this allows me to compile and run from the directory with ease. However my orginal problem of the main not found ended up being that my "jar" files needed for the import were in the "c:\j2sdk1.4.1_02\jre\lib\ext\" and that was fine for compiling, but the run the program my "jars" needed to be in the "c:\program Files\java\j2sdk1.4.1_02\jre\lib\ext\" directory. thanks again. Dean