Page 1 of 1

There's a first for everyone

Posted: Sat Dec 07, 2002 3:22 am
by startingOut
New user question.
I'm using Textpad with simple files on a Windows 98 box and I cannot get them to run. I load the HelloWorld.java file into Textpad then Tools-> Compile Java and it creates a nice .class file. I go to Tools-> Run Java Application and I get "Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld in the DOS window. What am I doing wrong?
Thanks

Re: There's a first for everyone

Posted: Tue Dec 10, 2002 7:15 am
by WUTTD
Does your file HelloWorld.java contain the method
public class HelloWorld
?

Re: There's a first for everyone

Posted: Tue Dec 10, 2002 7:16 am
by WUTTD
Does your file HelloWorld.java contain the method
public class HelloWorld
?

Re: There's a first for everyone

Posted: Wed Dec 18, 2002 6:09 pm
by willox2112
Hi:

Make sure that the location where the .class file has been saved is in your CLASSPATH variable. Better yet, add a '.' (dot) to the CLASSPATH, that way your current directory will always be part of the path.

Hope this helps.

-Willox2112

Re: There's a first for everyone

Posted: Mon Feb 03, 2003 3:37 am
by cindi
so did you get either of these to work I am having the same error..

Re: There's a first for everyone

Posted: Tue Feb 11, 2003 8:00 pm
by Mattias Olgerfelt
In Preferenses...Tools...Run Java Applications. are the paths to the source and java files correct: it should be set to:

"Initial Fodler" should be set to : $FileDir

Yea.. and inside the class mentionned abouve you need a Main method.
Please also note that the file must have the same name as the class. (case sensitetive)
file named test1.java should include:

public class test1{
public static void main(String[] args){
System.out.println("Hello Mattias!");
}
}

/Mattias

Re: There's a first for everyone

Posted: Thu Feb 20, 2003 5:02 pm
by Tijmen
Using skansholm????