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

Code error Xmx128m. Help a Rookie out :-)

Hello Team,

I am getting the below error, can someone please advise what I'm doing incorrectly?

treehouse:~/workspace$ javac Introductions.java
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Introductions.java:1: error: class, interface, or enum expected
fimport java.io.Console;
1 error

The below is what I've completed:

fimport 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("Hi my name is Les");

Cheers, Les

1 Answer

Jason Anders
Jason Anders
Treehouse Moderator 145,619 Points

Hi Leslie,

First, the lines beginning with "Picked up..." are not errors. This is explained in the Teacher's notes for the first video of the Java course and just has to do with Memory allocation in the Workspaces.
Next, the error message sort of tells you where to look and what the problem is. This line: "error: class, interface, or enum expected" is the actual error, and this one: "fimport java.io.Console;" is telling you where. With that in mind, you will notice a spelling error for your import. There seems to be an errant "f" preceding the import statement.
Also, it also looks like there is a missing closing brace for the class.

Give that a go and see if that works. If it doesn't, you'll need to make a snapshot of your Workspace and share that link here. Remember though, that those first couple of lines are not errors.

Moderator note: I added Markdown to your post so the code you provided is readable in the Community. Without Markdown, any code is pretty unreadable and therefore almost impossible to assist in troubleshooting. In the future, use the hints provided in the Markdown Cheatsheet (link is above the Post button) or have a look at the Markdown Course provided here at Treehouse.

Keep Coding! :) :dizzy:

Hi Jason,

Thank you for your reply. Error solved!

Feels good to get past the first video! haha

Cheers, Les