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 Data Structures - Retired Getting There Object Inheritance

David Hume
David Hume
10,334 Points

Workspace issue: javac: file not found

When I run javac Example.java I get this: javac: filenot found: Example.java

2 Answers

Simon Coates
Simon Coates
28,694 Points

Here it is working. Guess that means it should work. If there's something genuinely wrong with workspaces, you might want to talk to support.

treehouse:~/workspace$ ls                                                  
com  Example.java                                                          
treehouse:~/workspace$ javac Example.java                                  
treehouse:~/workspace$ ls                                                  
com  Example.class  Example.java                                           
treehouse:~/workspace$
David Hume
David Hume
10,334 Points

When I moved the Example.java file from the com folder to the default folder it found and compiled it.

Simon Coates
Simon Coates
28,694 Points

are you unfamiliar with the console? javac seems to accept linux style paths that should let you compile in a directory you're not currently in. cd folderName and cd ../ should let you move around the directory structure. Moving your files for compiling sounds a little indirect.