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

javac : file not found

It won't find the class i wrote. Please someone a little bit of help ?

1 Answer

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hi Enes,

what is the name of the class?

The terminal syntax should be "javac classname.java && java classname"

  • "classname" need to be exact like your name of the class in the code
  • upper or lowercase need to be correct

Could you paste your code ?

Grigorij

import java.io.Console;

public class M_String { public static void main (String args []) { Console cons = System.console(); String name = cons.readLine("What is your name ? "); cons.printf(" I'm %s ! \n", name); cons.printf("%s is coding in Java !\n",name); } }

I saved it like required M_String.html and when i wanna compile it i type as required javac M_String.java but it shows me that error.