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

akin kuelhanbey
akin kuelhanbey
7,474 Points

"Reached end of file while parsing" error


I am entering everything like the teacher says but I receive permanently the same error:

treehouse:~/workspace$ javac Introductions.java
Introductions.java:10: error: reached end of file while parsing
1 error

This is the code written so far:

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

Thanks a million in advance for all your help, folks.

Best akin

2 Answers

Kourosh Raeen
Kourosh Raeen
23,733 Points

Make sure you're not missing a closing }. There should one for the class and one for the main method.

Benneth Paredis
Benneth Paredis
4,597 Points

I think you are missing a "}" in the end.