Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception in thread "main" java.lang.NoClassDefFoundError: kolos/Main

 
Radek Ischyrion
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 5912
66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21218
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic