Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

noClassDefFoundError

  Asked By: Lorraine    Date: Jul 29    Category: Java    Views: 450
  

i have jdk5 installed in win xp sp2
when i do java <filename>
i get the error on my machine
Exception in thread "main"
java.lang.NoClassDefFoundError: <filename>
i correct it by doing
java -cp . <filename>
then it runs fine.

but on running a client ejb program on the command
line
AppClient -client <filename>
i again get the error
WARNING: ACC003: Application threw an exception.
java.lang.NoClassDefFoundError:
converter.ConverterHome
where converter.ConverterHome is contained in the jar
file

i do not get a solution to this problem
how can i correct the above problem or the overall
problem such that
when i give the command
java <filename>
i get the output simply

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Nagaraju Iyaner     Answered On: Jul 29

You got this error  because you may don't add path C:\j2sdk1.4.2_04\bin (I am
using J2SDK 1.4 example here but you please check your directory list first)
in your Windows Xp Environment Variables. Or you may compiling your Java
file from other folder than it is saved in or may be your java  file name is
wrong?



Do one of this:

(1) Check you are compiling Java file from same folder where
it is saved, for Ex: if you have saved your file in C:\Pradyut\Java then go
to C:\Pradyut\Java and they try to compile it by typing this in consol
window (Dos Prompt) javac hello.java. then java hello. (One good advice
while creating any class & class file please make each words first letter in
capital letter, For Ex: HelloJava.java, HelloWorkd.java end etc.).



(2) If you are using Windows other than NT technologies and
using Java2 J2SE1.4 (installed at "C:\j2sdk1.4.2_04\bin") then please add
this path "path=C:\j2sdk1.4.2_04\bin" to your autoexec.bat file. You can do
this by typing "edit autoexec.bat" on C:\ on MS Dos prompt. Or if you are
using Windows with NT technologies like windows 2000, NT or Xp then follow
these steps: -right click on My Computer on your desktop-click on
properties-then click on Advanced tab-click on Environment Variables
button-then find path in System Variables-select path-click on edit
button-then add ;C:\j2sdk1.4.2_04\bin at the end of line-then click OK,
Apply-OK.

 
Answer #2    Answered By: Tyrone Sanchez     Answered On: Jul 29

thanks for the help but i have taken note ur advice.yaar i have posted one more
code and someting is again wrong in it.pls help me subject name is help with
code

 
Answer #3    Answered By: Jonathan Brown     Answered On: Jul 29

I have the same problem, and do not know how to solve it. You way, by
setting the path doesnt work, I already had that path.

 
Didn't find what you were looking for? Find more on noClassDefFoundError Or get search suggestion and latest updates.