• 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
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

problems running code

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have just started to read the head first java i use a mac os x,
and since the sdk files are supposed to be included with
mac os x, i thought i should discover how to get my java codes
running, and so i haveused the following example in the book

public class abc {

private static void main (String[] args) {
System.out.print("i rule!");
System.out.print("the world!");

}
}

thank you all
[ September 28, 2005: Message edited by: AKIN Ojo ]
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Akin,

Could you post your code as well.
 
Rancher
Posts: 4393
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's one way to get that message. The file asdf does not exist in the current directory
>java asdf
Exception in thread "main" java.lang.NoClassDefFoundError: asdf

Check where the class file is.

When having runtime errors, please post all the console including what you entered.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> private static void main (String[] args) { ...

The main method should be public, not private.
 
reply
    Bookmark Topic Watch Topic
  • New Topic