• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic