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 trialLes Tricklebank
Courses Plus Student 115 PointsCode 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
Treehouse Moderator 145,860 PointsHi 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! :)
Les Tricklebank
Courses Plus Student 115 PointsLes Tricklebank
Courses Plus Student 115 PointsHi Jason,
Thank you for your reply. Error solved!
Feels good to get past the first video! haha
Cheers, Les