The following tutorial column fromJava Learningwill introduce you to the basic process of Java program execution. I hope it will be helpful to friends in need!
Let us take a look at the Java program execution process: For example, hellojava.java file, the code is as follows:
public class hellojava { public static void main(String[] args) { System.out.println("hello java!"); } }
Compile in the current directory: javac hellojava.java
Compile in the current directory Run: java hellojava
Output: hello java!
Description: Compilation is to compile the file, you need to write the file name hellojava.java; Run is to the class, so just write the class name.
Description: The java executable file will search for the hellojava class in the file in the corresponding directory according to the environment variable CLASSPATH. CLASSPATH contains the current directory, so the program can find the hellojava.class file in the current directory. hellojava class)
Related recommendations: "Java Programming Self-Study Network"
The above is the detailed content of Introduction to the basic process of Java program execution. For more information, please follow other related articles on the PHP Chinese website!