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 trialJohn Vieyra
2,826 Pointswhy does this not work?
import java.io.Console;
public class TreeStory {
public static void main(String[] args) {
Console console = System.console();
/* Some terms:
noun - Person, place or thing
verb - An action
adjective - A description used to modify or describe a noun
Enter your amazing code here!
*/
}
String noun = console.readLine("Write a noun: ");
String verb = console.readLine("Write a verb: ");
String adjective = console.readLine("Write an adjective");
console.printf("%s is the %s state in the world, it %s. ",noun,adjective,verb);
}
michaelcodes
5,604 PointsThat is good! that means that it compiled fine and can now be run :)
That message that you see is just because of certain settings that treehouse has applied to there workspaces compiler. It is totally normal.
michaelcodes
5,604 PointsIf you want a more in-depth explanation of this there was a discussion about the Xmx128m coming up about a week ago:
https://teamtreehouse.com/community/how-to-remove-picked-up-javatooloptions-xmx128m
2 Answers
michaelcodes
5,604 PointsHi there, it seems there is a misplaced ending curly brace } in the code, I inserted comments showing the old location and the new location it was moved it too.
import java.io.Console;
public class TreeStory {
public static void main(String[] args) {
Console console = System.console();
/* Some terms:
noun - Person, place or thing
verb - An action
adjective - A description used to modify or describe a noun
Enter your amazing code here!
*/
//<---There was an ending curly brace placed here (ended main)
String noun = console.readLine("Write a noun: ");
String verb = console.readLine("Write a verb: ");
String adjective = console.readLine("Write an adjective");
console.printf("%s is the %s state in the world, it %s. ",noun,adjective,verb);
}//<---Moved to this location to encompass the code
}
Take care and happy coding!
John Vieyra
2,826 PointsThanks bud!
John Vieyra
2,826 PointsJohn Vieyra
2,826 PointsThanks for responding michaelcodes. I did that and all it said was I picked up java_tool_options.:-Xmx128m