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

Viola Tian
Viola Tian
386 Points

I did the exact same thing, but it keeps saying error.

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

This is my code and I don't know where has gone wrong, could you please help me out? Thank you guys!

I am also getting a bash error when trying to run the program in the console. To explain further, I at first ran Introductions with the .java at the end, which gave the bash error, but now it won't stop giving the bash error when I input the run correctly, java Introductions. I still get the bash error....and I don't even know what bash means!

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi there.

You posted code is correct, so I'm not sure as to why you are receiving an error. :confused:

If you are working in Workspaces, it may have just been a glitch. (There is currently an ongoing issue regarding the functionality of Workspaces, that should soon be resolved.)

I guess, we should check the obvious thought:

  1. After saving your work (make sure the red dot is not visible in the tab of the workspace... this means the changes have not been saved).

  2. Run javac Introductions.java

  3. Run java Introductions

If this does not solve the error, you may need to send an email to the Treehouse Support Team

I hope everything works out. :) :dizzy:

Make sure your class name which is "Introductions" in your case is same as your file name in which you are writing your code.

.