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

John Smith
John Smith
39 Points

I tried the exercise of the first lesson. but It doesn't work for. Help me

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

} }

What wrong with the code above? Please help me. Whenever I try, the error show as below.

treehouse:~/workspace$ javac Introductions.java
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
treehouse:~/workspace$ javac Introductions.java
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m

Here is the Snapshop to check in detail.

https://w.trhou.se/jvnxme04ma

Thanks John

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,545 Points

Hi John Smith

You've got the code correct, just not using the correct console command. You are using javac and including the extension of the Class. Instead, you need to use java (no "c") and not include the extension.
So, is should be java Introductions

Craig explains this in the video at timestamp 6:01 - 6:15.

Keep Coding! :dizzy:

John Smith
John Smith
39 Points

Dear Jason,

Thanks a lot for your helpful tips and suggestion. It works now.

Thanks again. John