Home  >  Article  >  Java  >  Introduction to the basic process of Java program execution

Introduction to the basic process of Java program execution

藏色散人
藏色散人forward
2020-03-02 17:48:392204browse

Introduction to the basic process of Java program execution

The following tutorial column from Java Learning will 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!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete