• 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
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Head First Javaexercise problem

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

I got a problem with my exericese of Head First Java.

My code is :

It compiles fine, but won't output.

The error message is:

Exception in thread "main" java.lang.NoSuchMethodError: method java.lang.String.format with signature (Ljava.lang.String;[Ljava.lang.Object;) Ljava.lang.String; was not found.
at FullMoons.main(FullMoons.java:14)

My operating system is Ubontu Linux, and java version is 5.

Please help me with it.

Edit by mw: Added Code Tags and disabled smilies.
[ July 09, 2007: Message edited by: marc weber ]
 
author & internet detective
Posts: 42271
951
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yanli,
Welcome to JavaRanch!

Have you tried typing "javac -version" to make sure the version of Java being used is the same as the one you expect? It's possible an older version of Java is getting in the path first.
 
reply
    Bookmark Topic Watch Topic
  • New Topic