There's a first for everyone

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
startingOut

There's a first for everyone

Post 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
WUTTD

Re: There's a first for everyone

Post by WUTTD »

Does your file HelloWorld.java contain the method
public class HelloWorld
?
WUTTD

Re: There's a first for everyone

Post by WUTTD »

Does your file HelloWorld.java contain the method
public class HelloWorld
?
willox2112

Re: There's a first for everyone

Post 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
cindi

Re: There's a first for everyone

Post by cindi »

so did you get either of these to work I am having the same error..
Mattias Olgerfelt

Re: There's a first for everyone

Post 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
Tijmen

Re: There's a first for everyone

Post by Tijmen »

Using skansholm????
Post Reply