01_ Development of a Java program belongs to you
Java programs run principle
Java program goal is to compile once run everywhere, how did he do it?
We illustrated by the diagram:
By compiling we write java files into class files, and then run on the JVM class files, to complete the implementation of java files. That middle of this compilation and execution needs to have the support of a thing, is JDK. So, we need the official website to download the installation package. Note that different operating systems, JDK version is different.
JDK installation environment
After Jdk installation package download, here we demonstrate the process on windows installation:
Configuration environment variable
After installing the JDK, the relevant instructions not to do can be executed at any place, at this time, we need to configure the environment variable to achieve. See related operations shown below:
Note that after you configure the environment variables, to re-open the command line window, re-read the new configuration for the job.
Written our first java program
Create a file, named Hello.java
Contents of the file are as follows:
public class Hi{
// execution entry
public static void main(String[] args){
// write command you want to execute
// output a greeting on the screen
System.out.println("Hello,Java!");
}
}
We run a Java program
Programming is a practice discipline, and quickly hands it!
Reproduced in: https: //www.jianshu.com/p/c7eb90cfcdb7