| Author |
Exception in thread "main" java.lang.NoClassDefFoundError: kolos/Main
|
Radek Ischyrion
Greenhorn
Joined: Oct 21, 2010
Posts: 7
|
|
Hi there,
I have copied an pasted a code from an online turorial however it is generating errors on my end. The below is the code I copied and pasted from a web tutorial (so assume it's good). The code is however generating an error in my neatbeans. I excpet this to be fairly easy problem but still this is annoying. I would appreciate some info why this is ocurring
ERROR
thanks and regards, Radek
|
 |
Stephan van Hulst
Bartender
Joined: Sep 20, 2010
Posts: 3047
|
|
|
Your class is named Tut1, and NetBeans is looking for a class named Main. Either rename your class to Main, or go to your project configuration and change the main class to Tut1.
|
 |
Radek Ischyrion
Greenhorn
Joined: Oct 21, 2010
Posts: 7
|
|
Stephan,
Appreciate your response, however renaming the .java file didn't help. So didn't help renaming the class...
I have created a bit of code in Eclipse (below). The code is in randomArray.java file and compiles fine.
Now when I created the same file in NetBeans named randomArray.java and copied&pasted the code there, it's giving me the same error message.
NetBeans output:
I find this very confusing and would appreciate if you would be able to shed some light on this.
thanks and regards, Radek
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16687
|
|
Radek Ischyrion wrote:
I find this very confusing and would appreciate if you would be able to shed some light on this.
As already mentioned, NetBeans is looking to run a class named Main -- and not a class named Tut1 or RandomArray. I don't use netbeans so can't tell you where you went wrong.
Regardless, this looks like a NetBeans tools issue -- so moving to a more appropriate forum.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
 |
|
|
subject: Exception in thread "main" java.lang.NoClassDefFoundError: kolos/Main
|
|
|