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 Getting Started with Java Strings and Variables

The added string is not coming up in the console.

I followed the directions in the lesson by adding the extra string as displayed on https://w.trhou.se/dao93gn59v, and when compiled, the results were: treehouse:~/workspace$ javac Introductions.java
treehouse:~/workspace$ java Introductions
Hello, my name is Collistreehouse:~/workspace$, in which it did not yield the same result as the instructor.

2 Answers

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Hi Collis!

I forked your Workspace and found what you were saying was true. I recompiled the class and it worked, which probably means your first javac statement had an error, and it was compiled from a previous version.

treehouse:~/workspace$ java Introductions                                      
Hello, my name is Collistreehouse:~/workspace$ javac Introductions.java        
treehouse:~/workspace$ java Introductions                                      
Hello, my name is CollisCollis is learning how to write Javatreehouse:~/workspa
ce

Can you try recompiling?

I came across this exact issue. I'm not sure what you mean by recompiling. Could you please explain?

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 Craig");
    console.printf("Craig is learning how to write Java");

} }

treehouse:~/workspace$ javac Introductions.java
treehouse:~/workspace$ java Introductions
Hello, my name is Craigtreehouse:~/workspace$

Craig Dennis
Craig Dennis
Treehouse Teacher

Make sure your Introductions.java file is saved.

Glen Hayes
Glen Hayes
5,798 Points

Recompiling means re doing the java Introductions.java in the command prompt. This should work for you after then re entering java Introductions and hitting enter.