I believe that everyone is generally using the IDE environment to develop and run java files, but I think it is possible to simply run java files in the command line, and the skills are not overwhelming.
Next, let me talk about compiling and running java files:
- The first step is to start the next entry program ( note: the class name in the program must be the same as the name of the saved file )
-
- The second step, enter the directory where the java file is saved ( note: you must enter the saved directory, otherwise an error will occur )
- The fourth step uses javac HelloWorld.java to compile the source program to generate a .class intermediate code
- The fifth step is to use java HelloWorld to run the program ( note that you do not need to write .class at the end of the program after java )
-
-