Method: 1. Create a new java file containing program code in the desktop; 2. Open cmd and execute the "cd Desktop" command to enter the desktop; 3. Execute the "Java file name.java" command to compile; 4. Execute the "java file name" command to run the java program.
The operating environment of this tutorial: windows7 system, java10 version, DELL G3 computer.
To run a java program, we must first write a java program. Since what we are talking about here is just the running of the java program, I will start with a simple program!
1. Open your own notepad and enter the following code:
import java.util.*; public class HelloWorld{ public static void main(String[] args){ System.out.println("HelloWorld"); } }
java video tutorial"
The above is the detailed content of How to run java program. For more information, please follow other related articles on the PHP Chinese website!