Avoid development tools, do you remember how to run java programs with cmd commands? In the process, where are easy to go wrong, let us review it~
1. First open a notepad
. Have you ever wondered why there are many text files similar to notepads, such as WordPad, Word, etc.? Why can't they be used for direct execution? (The answer is given later)
2. Change the file extension to .java
3. Enter cmd in the windows search to open the command prompt
4. Import the folder where the file is located
5.javac compiles the .java file to turn it into a bytecode .class file
6. Interpret the .class file
Successful operation:
Summary:
Remember the above question? We can see the mistakes made in the two processes: if
there is a space, it can’t be executed. ↑
Notepad can’t execute.
The answer to the question is: Because the compiling ability of these text files is very low, many formatted symbols will affect the file generation machine code and thus make it impossible to compile. However, files such as word and WordPad will have many formatting symbols, which will result in failure to compile normally, or it can be understood that Notepad is the cleanest text file without fancy formats such as spaces and line spacing.