This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread 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 Murach's Java Servlets and JSP this week in the Servlets 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....
 
Similar Threads
WA #1.....word association
Getting error in setupConnection()
problem in retreiving value
Regarding tomcat
print statement in the declaration ...