• 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

Netbeans

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello...I am using Netbeans along with Head First Java. When I open up any project and copy and paste the code I get the following error:

run:
Exception in thread "main" java.lang.NoClassDefFoundError: PhraseOmatic
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)

Cans someone help me with this?

Thanks!
 
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Te wrote:Hello...I am using Netbeans along with Head First Java. When I open up any project and copy and paste the code I get the following error:

run:
Exception in thread "main" java.lang.NoClassDefFoundError: PhraseOmatic



Ideally, the 'NoClassDefFoundError' should come when you run your java class and NOT just after copy, paste the code.

It would be due to the fact that the IDE is NOT able to pick up the .class file of the class you are attempting to. Does the source file have any package statement? If so you should create a folder structure matching to that of package hierarchy and then try running it.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeff Te wrote:Hello...I am using Netbeans along with Head First Java. . . .

It's not usually a good idea to use an IDE (eg NetBeans) until you are a lot more experienced. Can't tell why you are getting that error without more details, but if you write the classes for yourself and put them into a folder structure, you can see what is happening. And make sure to take Raghavan Muthu's hint and leave out the package names at this stage.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic