Two, Java Introduction

A, Java language features

Object-oriented, high-performance, security, cross-platform, explanatory, multi-threaded, distributed processing, robustness, portability

Two, JRE and JDK Overview

  1. JRE includes the required Java Virtual Machine (JVM) and the Java program core class libraries;
  2. Develop a good run java program, the computer can only be installed JRE;
  3. JRE = JVM + core libraries
  4. JDK is available to Java developers, which contains Java development tools, including JRE;
  5. Install the JDK, you do not need to install the JRE;
  6. Java development tools: compiler tool javac, jar packaging tools package;
  7. JDK = JRE + Java development tools = JVM + core libraries + java development tools (javac, jar).

Three, JDK, JRE, JVM roles and relationships

JDK includes JRE, JRE included JVM, the whole JDK java for application development, while jre class is only run without compilation

 

Four, Javac / Java execution of the command path

  1. Javac is a command to compile the .java .class file
  2. Javac command specific path is: C: \ ProgramFiles \ Java \ jdk1.8.0_131 \ bin
  3. Java-version input terminal cmd, command execution of the Java application is in the environment variable in Path
  4. If you do javacHelloWorld.java return "javac" is not an internal or external command in the command, the program is not running, or batch file. Javac command could not be found in the current path.

Five, Java environment variable Path Configuration

Objective: do not need to go to the bin directory, the executable command in the bin directory javac

  1. New JAVA_HOME = C in the system variables: \ ProgramFiles \ Java \ jdk1.8.0_131
  2. In like editing environment variable Path, later recovered path% JAVA_HOME% \ bin (Note: is the right slash)
  3. At the command line, type echo% JAVA_HOME% \ bin to see the environment variables

Six, Classpath variable configuration

  1. Jvm If no classpath looks in the current directory when looking for class file, find the file in the class after setting the classpath classpath can only
  2. Classpath configuration is not required
  3. Once you modify environment variables thing, be sure to restart the cmd command line

Guess you like

Origin www.cnblogs.com/spfstep/p/11531068.html