Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Java Basics Getting Started with Java Introduction to Your Tools

Santiago Selva
Santiago Selva
1,241 Points

I'm doing something wrong but don't know what

I don't know what i'm typing wrong and this message appears:

8 errors
treehouse:~/workspace$ javac Introductions.java
Introductions.java:8: error: ';' expected
console.printf ("Hello, my name is Santiago");

4 Answers

Kourosh Raeen
Kourosh Raeen
23,732 Points

The line:

Console console = System.console(),

should be:

Console console = System.console();
Santiago Selva
Santiago Selva
1,241 Points

Thanks!!! That was it! I don't know when i changed it

Kourosh Raeen
Kourosh Raeen
23,732 Points

It looks like you're missing a semicolon at the end of the line: console.printf ("Hello, my name is Santiago")

Make sure it looks like:

console.printf ("Hello, my name is Santiago");
Santiago Selva
Santiago Selva
1,241 Points

I copy paste what you wrote, then I saved it but the same message keeps appearing...

treehouse:~/workspace$ javac Introductions.java
Introductions.java:8: error: ';' expected
console.printf ("Hello, my name is Santiago");
^
1 error

Seth Kroger
Seth Kroger
56,407 Points

Can you post your whole code?

Santiago Selva
Santiago Selva
1,241 Points

Thats the hole code:

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 Santiago"); 

} }

Then I type:

javac Introductions.java

And this appears: ^
1 error
treehouse:~/workspace$ javac Introductions.java
Introductions.java:8: error: ';' expected
console.printf("Hello, my name is Santiago");