aspose file tools
The moose likes Beginning Java and the fly likes can't understand - NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "can Watch "can New topic
Author

can't understand - NoClassDefFoundError

Satyendra Hari
Greenhorn

Joined: Nov 10, 2008
Posts: 1
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
Marshal

Joined: Jul 08, 2003
Posts: 24061
    
  13

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).


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: can't understand - NoClassDefFoundError
 
Similar Threads
thread problem
passing values from one method to other
assigment help
Jdbc Prepared Statement execute()
Need some help with Java program Airline.java