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

TreeStory.java clearing error

I used the text: clear && javac TreeStory.java && java TreeStory to clear it and got the errors below. Please advise where I went wrong. It appears my code is spot on yet something is amiss.

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 name = console.readLine("Enter your name: "); String adjective = console.readLine("Enter an adjective: "); console.printf("%s is very %s", name, adjective); }

}  

Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Error: Could not find or load main class Treestory

Simon Coates
Simon Coates
28,694 Points

if you provide a workspace snapshot, maybe someone can debug it for you.

1 Answer

Tabatha Trahan
Tabatha Trahan
21,422 Points

Did you copy/paste the actual command you used? It looks like you may have tried to run Treestory (with a lowercase s) rather than TreeStory. If you compiled TreeStory but tried to run Treestory, java won't be able to find it:

Error: Could not find or load main class Treestory