A, java Introduction
1.1 java is a programming language developed by the sun company, after the acquisition of the company by the oracle.
1.2 of well-known software such as the use of java: Thunder, QQ, Taobao, Jingdong
1.3 java good at the type of software:
1) Internet: electricity providers, p2p, etc.
2) enterprise applications: ERP, CRM, BOS, OA, etc.
Two, windows simple dos command
2.1 pop-dos console: windows + r, type cmd, and press Enter
2.2 commonly used commands:
Copy right with the mouse
cd .. into the upper folder
cd \ enter the root directory of the current drive letter
d: d switched into the disk drive letter
cd: D: \ JAVA_IDE \ eclipse2019 enter d: (c disc by the disc d into the process of a folder)
dir display a directory of all content
cls clear screen
View ipconfig ip address
Three, java development environment jdk
3.1 download and install jdk
3.2 JDK与JRE
1) JDK: java runtime environment development
2) JRE: java runtime environment, developers can not run if only to install only JRE.
3) JDK: contains the JRE
3.3 java environment variables
Finished configuring, dos window execution
Command java
Javac command
View results
3.3 cross-platform features
1) Platform: linux, windows, mac
2) java program write once, run on any platform
3) to achieve cross-platform dependent java virtual machine JVM (Java Virtual Machine)
Fourth, write HelloWorld Case
4.1 java program introduced
.java files (source file) → → .class file compiler (bytecode file) → → interpreter run
Roughly three steps: source files, compile, run
4.2 write HelloWorld source files
1) file attributes, display file extensions
2) d root directory file created HelloWorld.java
3) write code class, the class name and file name to be consistent, main method is to run the program entry, print string: hello world!
public class HelloWorld{
public static void main(String[] args){
System.out.println("hello world!");
}
}
4) dos window into the directory HelloWorld.java, HelloWorld.java file compiled by javac compiler to produce documents HelloWorld.class
Command: javac HelloWorld.java
5) Run HelloWorld.class, dos window
Command: java HelloWorld
Found printed: hello world!