• Post Reply Bookmark Topic Watch Topic
  • New Topic

can't understand - NoClassDefFoundError  RSS feed

 
Satyendra Hari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
last week i has a project on railway reservation. Its code goes here:

Above program is compiling sucessfully
But on running the program in console i get a "Exception in thread "main" java.lang.NoClassDefFounfError: JMain Error,which I failed to sort out.
Please help me sorting this error..
Thank you

[edit]Disable Smilies. CR[/edit]
[ November 10, 2008: Message edited by: Campbell Ritchie ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

You've probably got a setting for the CLASSPATH environment variable which does not include '.' (dot, the current directory.) As a result, java can't find JMain.class, even though it exists.

Try

java -cp . JMain

(that's java space dash cp space dot space JMain).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!