English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i'm trying to run this program.... but the following error is coimng up! i have no idea.. plz help me out!

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

ERROR:

Exception in thread "main" java.lang.NoClassDefFoundError: Helloworld


thanks!

2006-06-14 05:53:12 · 6 answers · asked by java programmer 2 in Computers & Internet Programming & Design

6 answers

Did you compile the program before you ran it?

javac Helloworld.java

that should compile with no errors.
then type

java Helloworld

I would recomend getting Java in a Nutshell if you don't already have it. It was my best friend my first year of college.

Also java.sun.com is helpful

2006-06-14 06:19:21 · answer #1 · answered by Schmancy 2 · 0 0

This is right answer
public class helloworld{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}

Save the source file with this name helloworld.java
After you can't get any error.

2006-06-14 06:19:42 · answer #2 · answered by Big Indian 2 · 0 0

Did you save the file as the same name as the class name. The File name should be Helloworld.java.

In java, the filename and the class name always have to be the same. Otherwise you will get this error message that you are getting.

I am sure this will help.

2006-06-14 05:55:50 · answer #3 · answered by Manish 5 · 0 0

Make the class public. Also, be sure to correct the case on the file name. I would encourage you to download Eclipse or even text pad while learning so that you don't have to deal with the command line. Both are free.

2006-06-20 11:03:20 · answer #4 · answered by brownfreckles1977 2 · 0 0

make sure that u spelled the class the same exact way as the file including the right caps

2006-06-14 05:57:11 · answer #5 · answered by dumbbaseballstar 2 · 0 0

yes ! first thing save the file name with the same class name . be carefull about the alphabets . its case sensitive

2006-06-14 05:58:46 · answer #6 · answered by Angoor 2 · 0 0

fedest.com, questions and answers