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
There's a first for everyone
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: There's a first for everyone
Does your file HelloWorld.java contain the method
public class HelloWorld
?
public class HelloWorld
?
Re: There's a first for everyone
Does your file HelloWorld.java contain the method
public class HelloWorld
?
public class HelloWorld
?
Re: There's a first for everyone
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
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
so did you get either of these to work I am having the same error..
Re: There's a first for everyone
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
"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