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 trialEmma Smith
4,400 PointsIt's not printing my name!
I have copied Craig's text and written my code as follows:
import java.io.Console;
public class Introductions {
public static void main(String[] args) {
Console console = System.console();
// Welcome to the Introductions program! Your code goes below here
console.printf("Hello, my name is Emma");
} }
I then compiled it to create the Introductions.class
But when I type java Introductions into the bottom box, it just shows this:
treehouse:~/workspace$ javac Introductions.java
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
treehouse:~/workspace$ ls
index.html Introductions.class Introductions.java
treehouse:~/workspace$ java Introductions
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
treehouse:
What have I missed?
2 Answers
Steven Parker
231,184 PointsDid you perhaps forget to save your editing changes (with the menu or Ctrl-S shortcut) before recompiling?
If that's not it, make a snapshot of your workspace and post the link to it here and we can investigate further.
Emma Smith
4,400 PointsYes! I forgot to save! Thanks so much. I remembered and went back to save, but I didn't compile again so it still wasn't working! So I started again and saved BEFORE compiling and it worked a treat - thanks so much!
Fabian Pijpers
Courses Plus Student 41,372 PointsI am just looking at some basic rules for c, c++ and java have basic rule of opening and closing brackets. And i am not aware of any syntax changes. Just looking for some common language typo's. This gave many errors in many times practicing and doing challenges. That is why i point it out in hopes of helping her. That was it.
Fabian Pijpers
Courses Plus Student 41,372 PointsFabian Pijpers
Courses Plus Student 41,372 PointsMaybe you forgot that } at the end to close it up. And as i recall from java it a go it was System.console.printline("Hello, my name is Emma"); Look at that.