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

wen at cmd prompt after succesful compilation at
java Filename
it givs me error that
exception in thread "main" java.lang.DefNotFound: Filename.
i hav written a program just to print a string Hello.
i hav Written main, ihave tried diff prog but same error ,have set path properly & many times,i hav tried java after reinstalling it but still the same error......
plz................ help me.......

2007-03-07 17:51:42 · 4 answers · asked by humtummonkey 3 in Computers & Internet Programming & Design

error is
Exception in thread "main" java.lang.NoClassDefFoundError: filename

2007-03-07 19:36:14 · update #1

4 answers

Try this website. It may have all the problems you are likely to encounter.

Good luck.

2007-03-07 21:02:24 · answer #1 · answered by AnalProgrammer 7 · 0 0

lets say this is ur code:
class test{
public static void main(String arg[]){
S.o.pln("hello..");
}
}

just make sure you save this file under test.java
if you are using the notepad, check if it is saved under test.java.txt, it is a common mistake.. the correct one is test.java

2007-03-08 02:12:45 · answer #2 · answered by abd 5 · 0 0

I guess, you gave different names for the file and class

It should be like

Example.java

public class Example {

.....

...
...
}

I guess you understand that the class name and file name must be same. Hope this will resolve.

2007-03-08 01:57:41 · answer #3 · answered by Rocks 2 · 0 0

give the full source code.might be issue with classpath.

2007-03-08 01:57:01 · answer #4 · answered by Kalyan 2 · 0 0

fedest.com, questions and answers