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 followed the instruction but it just could not printf ?

hi all, i am a newbie and i am confused: i did type at upper screen as follow:

[[[```java 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, i am noob");

} }

however when i type at lower window as follow:

[[[treehouse:~/workspace$ java introductions.java                                         
Picked up JAVA_TOOL_OPTIONS: -Xmx128m                                                  
treehouse:~/workspace$ javac introduction.java                                         
Picked up JAVA_TOOL_OPTIONS: -Xmx128m                                                  
Picked up _JAVA_OPTIONS: -Xmx128m                                                      
javac: file not found: introduction.java                                               
Usage: javac <options> <source files>                                                  
use -help for a list of possible options                                               
treehouse:~/workspace$ -help                                                           
bash: -help: command not found                                                         
treehouse:~/workspace$ javac introductions.java                                        
Picked up JAVA_TOOL_OPTIONS: -Xmx128m                                                  
Picked up _JAVA_OPTIONS: -Xmx128m                                                      
javac: file not found: introductions.java                                              
Usage: javac <options> <source files>                                                  
use -help for a list of possible options   ]]]


why is that guys?

2 Answers

Hey dawuud,

Is this the code that you wrote for the challenge, Strings, Variables, and Formatting? Or are you writing this freely within Workspaces?

hi thanks for your prompt answer,

i wrote it at the workspace under the video

i wroted it at the workspace under the video of Introduction to Your Tools by Craig Dennis

Ashrin Mathur
PLUS
Ashrin Mathur
Courses Plus Student 313 Points

2 things :

  1. when you compile, use "javac Introductions.java" NOTE THAT "I" in Introductions.java is uppercase.
  2. Next step is to run the code, use "java Introductions" NO NEED TO USE .java in the end or "javac"