Java Learning 01 Chapter 1, JRE and JDK
The JDK (Java Develop Kit,java SDK) provides the Java development environment and the operating environment, mainly for the development of Java programs, for Java program developers; Java Development Toolkit
JDK = JRE + tools (compiler, debugger, other tools ...) ) + Class Library
The JRE (Java Runtime Environment,java Runtime Environment) provides the Java runtime environment, primarily for executing Java programs and for users of Java programs. Java Run-time environment
JRE = JVM (Java virtual machine) Java VM + Interpreter
The Lib under Lib:jre is just the jar package that runs the Java program and is used for the JVM runtime. Includes all the standard class libraries, and extension classes.
2. Operating mechanism of Java language
? 1. Computer language
? 2. High-level computer language
? (1) Compiled language (c, C + +)
SOURCE file----compiler----run executable file---machine instructions
? (2) interpreted language (JavaScript, Perl)
Text File---interpreter, direct translation into machine instructions
? (3) Compile first, then explain (Java)
. Java source files----------Class bytecode file (bytecode) JVM does interpretation
Line-to-real machine instructions
Write Once, run anywhere (once written everywhere)
2. Structure of Java Program
3. The first Java program
1. Editing the program Helloworld.java file
public class helloworld{
public static void Main (string[] args) {
System.out.println ("Hello World");
}
}
2. Go to the file directory
CD F:
CD List
3. Compiling, running
Javac Helloworld.java generate bytecode. class
Java HelloWorld
4. Write run under Eclipse
(1) The file name is not the same as the class name
Javac + file name
Java + class Name
(2) A file has more than one class name the file name is the same as one of the class names
Javac file name
Java Individual class names
4. Environment variables
Path: Use Javac. Java commands or other JDK commands on any path
Classpath: Classpath tells JDK where the class file is located
Other tools for writing Java: notepad++ advanced Notepad
EditPlus jcreator eclipce MyEclipse Jbuilde
5. Javadoc Native HTML file 6, System API Help documentation
Help us find the use of functions to facilitate our programming
7. Garbage collection
System.GC () garbage collection
Runtime.getruntime (). GC (); garbage collection
8. Note:
1. If a class is a public class, the. java file name is identical to the public class name
2. A. java file should have only one public class
Java Learning 01