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 Receiving Input

for first introductions.java I am unable to run this class in the console workpace where the file should be to run it

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
        String firstName = console.readLine("what is your name?  ");
        //thisIsAnExampleOfCamelCasing
        console.printf("Hello, my name is %s\n", firstName);
        console.printf("%s is learning how to write Java\n", firstName);
  }
}

my program looks correct but it say Javac command not found after making html file and writing code in it, it is not clear what to do next ?

(l am providing some more detail here ) it is very simple concept but I have problem with console navigation and compilation. why we need to write in HTML, what is concept of upload and download of java file

3 Answers

Hello,

Do you have Java installed on your machine? If not, this could explain why your receiving that message.

Why are you trying to write Java in an HTML file?

Ryan Chan
Ryan Chan
4,076 Points

Hi!

Does your file end in .html or .java? If it ends in .html, right click it, click rename, and replace the .html with .java, this will make it a java file instead of a html file

Yes.. check your java file make sure it's "Introductions.java", and when you compile it:

$ javac Introductions.java $ java Introductions

Just like the tuts said.

Good luck.