This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Runtime Error.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Runtime Error...." Watch "Runtime Error...." New topic
Author

Runtime Error....

yunuss khan
Greenhorn

Joined: Apr 22, 2006
Posts: 17
Hi All,

while running the code i m getting an error at run time.

error is

"Exception in thread "main" java.lang.noClassdeffoundError:Room1"

room1 is my class name.

pls help

Thanks * Regards,
john
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Well, first: is the class name "Room1" or "room1"? Java cares -- it's case sensitive. Make sure you're typing the right one.

Have you compiled your class? In other words, is there now a file called Room1.class?

If all this is straightened out, then you may have a bad CLASSPATH setting. Try this:

java -cp . Room1

that's "java space dash cp space dot space Room1". That should work!


[Jess in Action][AskingGoodQuestions]
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Originally posted by yunuss khan:
Hi All,

while running the code i m getting an error at run time.

error is

"Exception in thread "main" java.lang.noClassdeffoundError:Room1"

room1 is my class name.

pls help

Thanks * Regards,
john


What are you giving at console as an Input...

room1 is my class name


and exception is

"Exception in thread "main" java.lang.noClassdeffoundError:Room1"


That mean you are typing

java Room1


you must try

java room1

Hope this helps.... If still any concern then revert with exact details.. what are you using....exactly...


The Best way to predict your future is to create it - Every great individual common man
yunuss khan
Greenhorn

Joined: Apr 22, 2006
Posts: 17
Hi Ernest,

thanks for your help.. can you please let me know how can i set the classpath or path pernamently.

on command prompt i m typind c:\jdk1.5.0_06\bin

pls help,

Regards,
yunus
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

See http://faq.javaranch.com/view?HowToSetTheClassPath

Pay special attention to the part that suggests not setting it at all! If you do choose to set it to something make sure "." (dot) is included.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Runtime Error....