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

reached end of file while parsing, help?

Console

1 error javac Introductions.java Introductions.java:9: error: reached end of file while parsing console.printf ("Christoffer is learning Java");

1 error ^

7 Answers

You made need to add more code such as:

import java.io.Console;

public class Introductions{

    public static void main(String[]  args){
       Console console = System.console();
       console.printf("Learning Java!\n");

    }

}

This typically means that you didn't add a closing curly brace somewhere: Every class and method should have an opening and closing curly brace '{ }'.

Added a closing curly brace now, but new error comes up: Class names, "Introductions", are only accepted if annotation processing is explicitly requested. I've done everything that was being done in the tutorial, weird.

Okay post all of your code and I will try to figure out what the deal is.

Are you typing it in workspaces?

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 Christoffer\n");
    console.printf ("Christoffer is learning Java\n");  }

That's what i got so far, thank you for all the fast replies and help :) Still nothing though.

It looks like you are still missing the last closing curly brace- I see one for your method main() but not your class.

You also need to delete the space between your printf and the first paranethesis- it shouldn't be there.

Thank you so much for your help! It is great to see a community like this with so many skilled people : ) It all worked out just perfect now.

Good deal!!! I'm glad you got it working :)