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

Lamar Tabb
Lamar Tabb
269 Points

Java basics course Im stuck already with my first hello world. I get some errors when I run javac

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

} }

What error is it throwing? It looks like it should compile and run as is.

Lamar Tabb
Lamar Tabb
269 Points

Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m

2 Answers

Lamar Tabb
Lamar Tabb
269 Points

treehouse:~/workspace$ java Introductions
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Hello, my name is Lamar

So do I not use the javac command in the workspace but javac should work ooutside of that

That's not an error. That's what comes up when you compile the program with javac using the console in workspaces. Now to run the program type in

java Introductions

That should work.