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

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

Did you put your sign that ends the code. ;

4 Answers

You did not put your ending sign when it did. ‘;’ it is telling you that you forgot the thing in the apostrophes.

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.