Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Basics Using your New Tools Multiple Strings

I get these errors and the complete sentence does not print to the screen...

I wrote out the challenge exactly but still get this error in the console...

Picked up _JAVA_OPTIONS: -Xmx128m
treehouse:~/workspace$ java TreeStory
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Enter your name: James
Enter an adjective: Smart
Exception in thread "main" java.util.MissingFormatArgumentException: For
'%s'
at java.util.Formatter.format(Formatter.java:2519)
at java.util.Formatter.format(Formatter.java:2455)
at java.io.Console.format(Console.java:170)
at java.io.Console.printf(Console.java:209)
at TreeStory.main(TreeStory.java:15)
treehouse

anyone can help?

foxtails
foxtails
3,655 Points

Do you have these last three lines in your code? And have you saved your code before compiling it?

console.printf("Your Tree Story:\n-----------\n"); console.printf("%s is a %s %s. ", name, adjective, noun); console.printf("They are always %s %s.\n", adverb, verb);

As to me it looks like Java can't find your definitions for %s and therefore can't print the text.

Hope this helps!

3 Answers

Thanks foxtails... You are correct, I hadn't saved before running the script. Thanks for the speedy reply :)

foxtails
foxtails
3,655 Points

You are welcome! ;)

Kay Ellis
Kay Ellis
157 Points

I got this error too but when I looked at the sentence... i had added s% instead of %s. I corrected the error and re-saved it. I was able to print the full sentence! Hope this helps someone else.