944,052 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 169339
  • Java RSS
You are currently viewing page 1 of this multi-page discussion thread
May 23rd, 2005
0

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

Expand Post »
Hi,

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

Thanx.
Similar Threads
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
May 23rd, 2005
0

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

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
Reputation Points: 10
Solved Threads: 0
Light Poster
yassar is offline Offline
35 posts
since May 2005
May 24th, 2005
0

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

yassar, thanx! I sorta understand this, but is there a specific line of code i need 2 fix???
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
May 24th, 2005
0

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

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.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
May 24th, 2005
0

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

server_crash, thanx! what directories do the classes, .java files, and the sounds and images have 2 be in?

Thank you again.
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
May 24th, 2005
0

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

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?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
May 24th, 2005
0

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

server_crash, I'm using borland jbuilder 9 academic.
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004
May 25th, 2005
0

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

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
frankcs is offline Offline
13 posts
since May 2005
May 25th, 2005
0

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

Quote 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.
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
May 25th, 2005
0

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

server_crash, there's an option called "Output Path" you can change. Is this what I'm looking for?
Reputation Points: 12
Solved Threads: 2
Posting Whiz
Ghost is offline Offline
352 posts
since Aug 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in Java Forum Timeline: An Editor Application like MS Word
Next Thread in Java Forum Timeline: if else if else else if if else !





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC