User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 426,454 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,263 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 102713 | Replies: 58
Reply
Join Date: Aug 2004
Location: Los Angeles
Posts: 345
Reputation: Ghost is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #1  
May 23rd, 2005
Hi,

I'm trying to run my program in command prompt, but i get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: Invaders
Can anybody tell me what this error means?

Thanx.
CRD
Join the CRD forums! If you're one of the first 4 people to post in a topic, you get FREE web hosting with:
Apache WWW Host
Unlimited (within reason) storage
Unlimited (within reason) bandwith
PHP
mySQL
FTP
Unlimited Subdomains Hosted
Unlimited Domains Hosted

ALL FREE!!

Click here to visit
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2005
Location: Turkey
Posts: 20
Reputation: yassar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
yassar's Avatar
yassar yassar is offline Offline
Newbie Poster

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #2  
May 23rd, 2005
From the documentation


public class NoClassDefFoundError
extends LinkageError

Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.

The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.

Since:
JDK1.0
See Also:
Serialized Form
Reply With Quote  
Join Date: Aug 2004
Location: Los Angeles
Posts: 345
Reputation: Ghost is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #3  
May 23rd, 2005
yassar, thanx! I sorta understand this, but is there a specific line of code i need 2 fix???
CRD
Join the CRD forums! If you're one of the first 4 people to post in a topic, you get FREE web hosting with:
Apache WWW Host
Unlimited (within reason) storage
Unlimited (within reason) bandwith
PHP
mySQL
FTP
Unlimited Subdomains Hosted
Unlimited Domains Hosted

ALL FREE!!

Click here to visit
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #4  
May 24th, 2005
No, it's nothing with your code. The class file cannot be found. This is common while using IDE's. The source file is placed in one directory, while the class file somehow ends up in another, and the JVM is looking in the directory that stores the source. Make sure that you have the classfile in the correct directory.
Reply With Quote  
Join Date: Aug 2004
Location: Los Angeles
Posts: 345
Reputation: Ghost is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #5  
May 24th, 2005
server_crash, thanx! what directories do the classes, .java files, and the sounds and images have 2 be in?

Thank you again.
CRD
Join the CRD forums! If you're one of the first 4 people to post in a topic, you get FREE web hosting with:
Apache WWW Host
Unlimited (within reason) storage
Unlimited (within reason) bandwith
PHP
mySQL
FTP
Unlimited Subdomains Hosted
Unlimited Domains Hosted

ALL FREE!!

Click here to visit
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #6  
May 24th, 2005
It's whatever the JVM and JRE are pointing to. If your using an IDE, which I think you are, then the path should be pointing to the directory were the files are located, but in weird circumstances it's not.

What IDE are you using?
Have you looked at the folder that's "suppose" to cotain these files to make sure they are there?
Reply With Quote  
Join Date: Aug 2004
Location: Los Angeles
Posts: 345
Reputation: Ghost is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #7  
May 24th, 2005
server_crash, I'm using borland jbuilder 9 academic.
CRD
Join the CRD forums! If you're one of the first 4 people to post in a topic, you get FREE web hosting with:
Apache WWW Host
Unlimited (within reason) storage
Unlimited (within reason) bandwith
PHP
mySQL
FTP
Unlimited Subdomains Hosted
Unlimited Domains Hosted

ALL FREE!!

Click here to visit
Reply With Quote  
Join Date: May 2005
Posts: 13
Reputation: frankcs is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
frankcs frankcs is offline Offline
Newbie Poster

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #8  
May 25th, 2005
well........the error means the JVM can not
find the class file................
there cud b 2 reasons for that...
1. if the class file is not created at all i.e.
being not compiled successfully.
2.the path is not properly set,i.e. JVM
is not finding the class file where it is looking.......

as u said u ar using borland jbuilder.......
dunno bout jbuilder but generally there wud b a directory option
see thru the options and see where
ur directories options are pointing to
and assign the path where ur class files ar created
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #9  
May 25th, 2005
Originally Posted by C++
server_crash, I'm using borland jbuilder 9 academic.

It will be hard for me too help because I don't have JBuilder. Ok, look for an option to change the properties of your project. If you find it, it should say something about the source path,classpath, or the output path. Change it to the directory containing the file your trying to run. That should clear it up.
Reply With Quote  
Join Date: Aug 2004
Location: Los Angeles
Posts: 345
Reputation: Ghost is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
Ghost's Avatar
Ghost Ghost is offline Offline
Posting Whiz

Re: Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error

  #10  
May 25th, 2005
server_crash, there's an option called "Output Path" you can change. Is this what I'm looking for?
CRD
Join the CRD forums! If you're one of the first 4 people to post in a topic, you get FREE web hosting with:
Apache WWW Host
Unlimited (within reason) storage
Unlimited (within reason) bandwith
PHP
mySQL
FTP
Unlimited Subdomains Hosted
Unlimited Domains Hosted

ALL FREE!!

Click here to visit
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 3:23 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC