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 trialOluwafemi Olosunde
1,900 PointsWhen I try to find the result of my code it never works
Whenever I try to on any workspace on any lesson
8 Answers
Craig Dennis
Treehouse TeacherAha! I think the file is not saved. You should choose File>>Save from the editor menu.
Oluwafemi Olosunde
1,900 PointsThank you, all I needed to do was save the file
Craig Dennis
Treehouse TeacherIs it not compiling when you call javac and you are receiving an error?
Oluwafemi Olosunde
1,900 PointsNo, the result is not showing when I call java
Craig Dennis
Treehouse TeacherHmm... can you attach your code here as well as what command you are running on the command line please? We'll figure it out together!
Oluwafemi Olosunde
1,900 Pointsimport java.io.Console;
public class Introductions {
public static void main(String[] args) {
Console console = System.console();
console.printf("Hello, my name is Oluwafemi/n");
console.printf("Oluwafemi is learning to write Java/n");
}
}
treehouse:~/workspace$ javac Introductions.java
treehouse:~/workspace$ java Introductions
treehouse:~/workspace$
Craig Dennis
Treehouse TeacherOne thing to note here is that you have a /n
and it should be \n
. I don't think this is causing your problem, but you will want to fix that.
Craig Dennis
Treehouse TeacherWeird...let's make sure the file is saving correctly. Can you try this on the command line:
treehouse:~/workspace$ cat Introductions.java
Oluwafemi Olosunde
1,900 PointsIt didn't give me the result of my code