Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Very Common Error But I'm a noob

 
Roan Kaas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?!

Regards,
Roan

[ July 23, 2005: Message edited by: Roan Kaas ]
[ July 23, 2005: Message edited by: Roan Kaas ]
 
Kristin Stromberg
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest that you read and do everything specified in this tutorial. It help in 99% of the cases of someone having this problem.
 
Roan Kaas
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what error do you get, or what happens? "It doesn't work" doesn't tell us much!
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import.awt.*; or import.awt.event.*;


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

import java.awt.*;
import java.awt.event.*;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic