File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Very Common Error But I'm a noob Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Very Common Error But I Watch "Very Common Error But I New topic

Very Common Error But I'm a noob

Roan Kaas

Joined: Jul 23, 2005
Posts: 3
Ok. I have found this error EVERYwhere but I am unable to fix my problem

Ok. I bought this java book. And in the book I'm suppose to download Java. So i do that. Now, I've created a .JAVA file that complies into PARTY.class. Now the java main folder is C:\JAVA. The .Class and the .JAVA file are located in C:\Java2. Now BOTH of those folders and C:\JAVA\Bin are placed in both PATH and CLASSPATH. AS I said it complies but it WILL not run. I get a "Exception in thread "main" java.lang.NoClassDefFoundError: Party/class" error. This may be simple to fix but I'm a noob so PLEASE be patient and give me a step by step. I have become very frusterated with this. If java is this hard to set up how do the Java creators hope to spread popularity of their product?!


[ July 23, 2005: Message edited by: Roan Kaas ]
[ July 23, 2005: Message edited by: Roan Kaas ]
Kristin Stromberg
Ranch Hand

Joined: May 17, 2005
Posts: 91
Make sure you are typing "java Party" to run the file (and not "java Party.class").
[ July 23, 2005: Message edited by: Kristin Stromberg ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
I suggest that you read and do everything specified in this tutorial. It help in 99% of the cases of someone having this problem.

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Roan Kaas

Joined: Jul 23, 2005
Posts: 3
Ok. Thank you for that site. I now only have one problem. When I try to create a normal CLASS file and run it it doesn't work if i've used import.awt.*; or import.awt.event.*;

Yet when I do the same but make it an applet it runs FINE. What am i doing wronge. As i said if those two import's arn't there the command line runs fine
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

So, what error do you get, or what happens? "It doesn't work" doesn't tell us much!

[Jess in Action][AskingGoodQuestions]
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

import.awt.*; or import.awt.event.*;

I believe this is a typo. Else, it should be :

import java.awt.*;
import java.awt.event.*;

[My Blog] [JavaRanch Journal]
I agree. Here's the link:
subject: Very Common Error But I'm a noob
It's not a secret anymore!