Cause one:
The suffix name of the java source file is wrong.
Solution:
Open the computer, select "Options" in "File" in the upper left corner and click;
(Video tutorial recommendation:java视频)
Select "View", find "Hide extensions for known file types" in "Advanced Settings", and click to remove the check mark.
Cause two:
The java source file and the current command are not in the same directory.
Solution:
If your Demo.java source file is under d:\ and the command line is under c:\, then you can execute the command: javac d:/Demo.java
Or enter the directory directly, type d:\, press Enter, and then execute the command: javac Demo.java. After compilation, execute the java Demo command to run.
Recommended tutorial:Getting started with java development
The above is the detailed content of What should I do if the javac command prompts that the file cannot be found?. For more information, please follow other related articles on the PHP Chinese website!