Home >Java >Javagetting Started >How to run java files
1. Prepare a jdk and copy the bin directory of the jdk, as shown in the figure below:
2. Then enter the PATH environment Add the JDK bin directory to the variable, as shown in the figure below:
3. Then write a java program, as shown in the figure below, just use Notepad
4. Then open the CMD command line and use the javac command to compile the java file, as shown below:
5. Finally Just use the java command to execute the compiled java file, as shown below:
Recommended tutorial: Java 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!