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 Java Basics Getting Started with Java Introduction to Your Tools

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,860 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:

Dear Jason,

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

Thanks again. John