• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Very Common Error But I'm a noob

 
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 ]
 
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 ]
 
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
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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!
 
Sheriff
Posts: 10445
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
Boost this thread!