jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes Head First Javaexercise problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Head First Javaexercise problem" Watch "Head First Javaexercise problem" New topic
Author

Head First Javaexercise problem

Alexandra Zhang
Greenhorn

Joined: Jun 08, 2007
Posts: 16
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

Joined: May 26, 2003
Posts: 32481
    
214

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.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Head First Javaexercise problem
 
It's not a secret anymore!