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

Introductions.java:8: error: ';' expected

So my problem is that whenever i try to compile the the code by using (javac Introductions.java) It comes up with an error code saying Introductions.java:8: error: ';' expected
console.printf("Hello, my name is Michael")
^
1 error
Ive tryd to fix this problem and its still just giving the same error If someone could help me fix this, that would be great. Thank you

4 Answers

I tryd putting the ending signs and it still didnt work

I tryd putting the ending signs and it still didnt work

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Michael;

Welcome to Treehouse. I'm excited to see you learn here and you've picked a great starting point with Java.

It would be very helpful to see all of the code you have written in Introductions.java. Please post back and we can get this sorted out. That error message is fairly common in Java, but seeing the entire bit of code is incredibly helpful when attempting to debug.

Thanks and I look forward to seeing you post again.

Ken

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Michael;

You're missing a semi-colon at the end of line eight. With that in place, the code runs as expected.

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 Michael");
  }
}

Let's walk through the error message you were getting a bit:

Introductions.java:8: error: ';' expected

  • Introductions.java is the file name that has an error.
  • 8 is the line with the error
  • ';' expected is what the error is
  • The carat, ^ on the next line is pointing to where the error occurred.

Post back if you're still stuck.

Happy coding,
Ken

I'm trying to put that down and in my workspace even after I put the ';' it still doesn't work at all. but the error message keeps popping up.