Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First Javaexercise problem

 
Alexandra Zhang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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 ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic