• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

java.lang.noclassdeffounderror while testing ButtonDemo.java from Oracle tutorials

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I was trying the BottonDemo.java from Oracel tutorials (the source code is pasted below). It compiled fine, but gave me a java.lang.noclassdeffounderror at run time. I tried to google what this error is about and found this post helpful (http://javaeesupportpatterns.blogspot.com/2012/06/javalangnoclassdeffounderror-how-to.html). I kinda understand what the author says, but I am a complete newbie, so I am still clueless as how to solve this problem.
Since I just started learning Java and CS, so my questions are: what should I do next? (including reading books, tutorials, etc. ???) Should I just leave this problem alone at this point since I just started learning? Thanks a lot!!

the code: http://docs.oracle.com/javase/tutorial/displayCode.html?code=http://docs.oracle.com/javase/tutorial/uiswing/examples/components/ButtonDemoProject/src/components/ButtonDemo.java


 
Ranch Hand
Posts: 231
1
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, Jiangbo Tang.

First of all do a search for your problem from Search link on top of the page. [link]
A sample search shows up here [java.lang.NoClassDefFoundError]

You will find existing solution to most of your problems and you dont have to reinvent the wheel everytime.

Also have a look at http://javarevisited.blogspot.in/2011/06/noclassdeffounderror-exception-in.html.
Then may be, you can post here what you understood and if it helped!
 
Bartender
Posts: 825
5
Python Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello and welcome to the Ranch!

Are you compiling your code from the command line? If so, can you please paste the commands you used to both compile and run the example code? Make sure you copy it from the command line so we can see the directory you are currently in, e.g.:
 
Slime does not pay. Always keep your tiny ad dry.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic