•
•
•
•
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
![]() |
Hi,
I'm trying to run my program in command prompt, but i get this error:
Can anybody tell me what this error means?
Thanx.
I'm trying to run my program in command prompt, but i get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: Invaders
Thanx.
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
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
yassar, thanx! I sorta understand this, but is there a specific line of code i need 2 fix???
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
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.
server_crash, thanx! what directories do the classes, .java files, and the sounds and images have 2 be in?
Thank you again.
Thank you again.
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
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?
What IDE are you using?
Have you looked at the folder that's "suppose" to cotain these files to make sure they are there?
server_crash, I'm using borland jbuilder 9 academic.
•
•
Join Date: May 2005
Posts: 13
Reputation:
Rep Power: 4
Solved Threads: 0
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
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
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
•
•
•
•
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.
server_crash, there's an option called "Output Path" you can change. Is this what I'm looking for?
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the Java Forum
- Previous Thread: Assigning Array Values En Masse
- Next Thread: Q. Lotus Notes + Java?



Linear Mode