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

David Hinton
David Hinton
3,070 Points

javac: file not found: Example.java

I have followed the video exactly the same

import com.teamtreehouse.Treet;

public class Example{

public static void main(Strings[]args){ Treet treet = new Treet(); System.out.printf("This is a new Treet: %s %n", treet); }

}

But when I try to compile I get the error

treehouse:~/workspace$ javac Example.java && java Example
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
javac: file not found: Example.java
Usage: javac <options> <source files>
use -help for a list of possible options

Teja Tummalapalli
Teja Tummalapalli
5,592 Points

Hi, Did you execute this snippet in the folder where the example resides?? The place of execution matters as you are providing the relative path for the compiler

2 Answers

David Hinton
David Hinton
3,070 Points

Yeah in the teamtreehouse folder I have the Treet file and the Example file , confused :S

Try typing in ls (with a lowercase L, not the number 1) into the Console.

What do you see?

David Hinton
David Hinton
3,070 Points

treehouse:~/workspace$ ls
com