Java-javac Hello. java cannot find the file, javachello. java
At the beginning of writing Java code, you may encounter many difficulties. The following is a common error:
For beginners, it is generally learned from Hello and World. After a long time, I have to run javac Hello on DOS. in java, an error is reported: the file cannot be found.
To solve this problem, perform the following steps:
1. After configuring the path, close all previously opened dos and re-open it.
In this way, it can redefine and identify the new path you configured.
2. Check whether the environment variables are correctly configured.
Output A javac command to output help information, indicating that the configuration information is correct (indicating environment variable configuration, no problem ).
3. If the environment is correctly configured, check whether the path of the executed java file is correct.
4. This problem is more likely to occur. .
(In front of me, I am in a hidden state, but I cannot see the. txt and. java files suffixed with the following two files)
My computer is a win10 system. Find the "Hide extensions of known file types" setting method as follows:
This computer --> file --> change folder and search options --> View --> advanced settings --> hides the extensions of known files,Uncheck this option
Then you can see whether your suffix is incorrect.
If it is not a win10 system, it should be: My computer --> Tools --> Folder Options --> View -->-hide extensions of known file types. Check the box to remove them.
After the above troubleshooting, my verification is successful and may help you.