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 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,733 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,733 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,413 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");