This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Jiangbo Tang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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


 
Rajdeep Biswas
Ranch Hand
Posts: 231
1
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • 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!
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • 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.:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!