Explorer060599
asked on
main exception
hi experts, l'm having a terrible problem. i just downloaded the j2sdk1.4.0 and get it installed in windows me. i had set the path=c:\j2sdk14\bin where i installed the jdk and wrote a simple program to test as follow
public class test
{
public static void main( String args[] )
{
System.out.println("testin g");
}
}
saved as test.java. i ran "javac test.java" and returned no error.then i ran "java test" and return "exception in thread "main" java.lang.NoClassDefFoundE rror :test". i really do not know what happens. pls help.
public class test
{
public static void main( String args[] )
{
System.out.println("testin
}
}
saved as test.java. i ran "javac test.java" and returned no error.then i ran "java test" and return "exception in thread "main" java.lang.NoClassDefFoundE
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
oh..yeah, you are my god. thanksssss so much. dumb me.
No worries, happy to help :-)
http://www.objects.com.au
Brainbench MVP for Java 1
http://www.brainbench.com
http://www.objects.com.au
Brainbench MVP for Java 1
http://www.brainbench.com
You need to include the directory that contains your class in you classpath.
eg. if your class file is in c:\javastuff\test.class
then use:
java -classpath c:\javastuff test
or if you are in the same directory as the classpath you can use:
java -classpath . test