Executing java on the command line is very important, whether in development or testing. It is a process to use cmd command to compile, execute and package java files. Here we only describe the compilation and execution process.
First create a txt, change it to test.java
Write code, and the output is hollow
Find cmd and open cmd
Compile the java file and enter the command javac test.java
If no error is reported, check whether there is a class file in the current directory.
Execute the class file, enter java test in the command, and the output is hollow
For more java knowledge, please pay attention to java basic tutorial.
The above is the detailed content of How to run java files. For more information, please follow other related articles on the PHP Chinese website!