I have a filename named \"first.java\" saved on my desktop in notepad++. When I run the cmd command \"javac first.java\" it gives me this error.
javac: file
first set the path of jdk bin steps to be follow: - open computer properties. - Advanced system settings - Environment Variables look for the system variables -Click on the "path" variable - Edit copy the jdk bin path and done.
The Problem is you just open the command prompt which is default set on current user like "C:\users\ABC>" You have to change the location where your .java file store like "D:\javafiles>"
Now you are able to run the command javac filename.java
So I had the same problem because I wasn't in the right directory where my file was located. So when I ran javac Example.java
(for me) it said it couldn't find it. But I needed to go to where my Example.java
file was located. So I used the command cd
and right after that the location of the file. That worked for me. Tell me if it helps! Thanks!