Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Exception in thread "main" Java.lang.NoClassDefFoundError

  Asked By: Trupti    Date: Apr 01    Category: Java    Views: 1394

check out my link <br>explains the problem I am having with:<br>Exception in
thread "main" Java.lang.NoClassDefFoundError<br><br><a



4 Answers Found

Answer #1    Answered By: Dinh Tran     Answered On: Apr 01

You need to execute your application with the command:<br><br>java App<br><br>Do
not include the .class.

Answer #2    Answered By: Ann Evans     Answered On: Apr 01

Try to do this:<br><br>java App<br><br>I got the result. This is the command
that is used to execute compiled java  programs.

Answer #3    Answered By: Dan Romero     Answered On: Apr 01

Your program compiles and runs successfully on my
machine. There is no program error.<br><br>The problem  is
that you are applying some logic that should not be
applied, in this case.<br><br>To compile java  modules, you
MUST supply the .java extension: javac
App.java<br><br>But, to execute, you must NOT supply the .class
extension. Therefore:<br>java App // works<br>java App.class
// throws the error<br><br>Consistency does not hold
in this case.<br><br>Try again and see if that works
for you (removing .class).

Answer #4    Answered By: Clint Garcia     Answered On: Apr 01

but those previous answers weren't there when I started working on
this one.Everybody else works faster than I do!

Didn't find what you were looking for? Find more on Exception in thread "main" Java.lang.NoClassDefFoundError Or get search suggestion and latest updates.