JAVA entry configuration environment variable

A, Java Overview

1, java founders: Sun Company in 1982, Sun Microsystems company was born in Stanford University campus, Sun has the world's largest supplier of UNIX systems. In 2009, Sun has to USD 7.4 billion yuan was acquired by Oracle Corporation. Father of Java: James Gosling.

2, JDK important terms:

(1) JDK java development kit that provides a development, run java program all the tools (not jdk not do java development).

(2) Environment JRE java runtime environment necessary to run Java programs.

(3) JVM java virtual machine to run java program and core software.

(4) API application programming interface, java especially javaDOC document.

(5) GC memory object garbage collection, lazy automatic recovery.

(6) IDE integrated development environment, is an integrated edit, compile, run, debug, deploy applications, and integration-party software, such as the function of application server, database and other software.

3, Java language features: simple (C ++ class allows multiple inheritance, Java classes, only single inheritance), object-oriented language, cross-platform  

4, Java development process:

Hello.java editing source code, compiled by a compiler Hello.class (the ByteCode byte code file (binary) is loaded and interpreted by the JVM). In different operating system platforms, install the corresponding JDK software, but the same Java specification used to interpret the same .class files. ---- idea: by JDK / JVM mask differences in the underlying operating system.

5, an important step in the development of Java △

  (1) Download and install JDK URL: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html , click here to pay attention to Accept License Agreement, or can not download. After downloading a good jdk installation package, simply double-click to run, the installation process is very simple and you can just click Next. After successful installation you can see the installed files in the C drive Program Files.

  (2) C: \ Program Files \ Java \ directory under jdk1.8.0_201:

  bin directory: binary binary file * .exe files stored jdk main commonly used commands, such as javac.exe is to start the compiler source code, java.exe is responsible for running the program responsible for starting the JVM run.

  jre \ lib directory: rt.jar file, .class files JDK core library archive, * jar and * .zip compression ratio is the same. Abbreviation src.zip:src source is the source code. java is an open source language, open source.

  (3) configuration environment variable: My Computer -> Properties -> Advanced -> Environment Variables

 

  •  JAVA_HOME

    Variable name: JAVA_HOME

    Variable value: C: \ Program Files \ Java \ jdk1.8.0_201 (find java files under C disk Program Files, open jdk copy path)

  • PATH   

    Variable name: PATH

    Variable Value: Mode 1: Copy the JAVA_HOME variable value, added after \ bin; (C: \ Program Files \ the Java \ jdk1.8.0_201 \ bin;)

        Second way:% JAVA_HOME% \ bin;

  • CLASSPATH

    Variable name: CLASSPATH

    variable:.

检查配置环境变量是否正确:可通过java、javac、java -version等命令,出现以下信息即配置正确。

java -version  查看到当前JDK的版本号

 

(4)编译  javac 源文件名

E:\>javac HelloWorld.java    如果成功了,会生成一个.class文件。

(5)运行   java 类名

 

Guess you like

Origin www.cnblogs.com/lulujiang/p/10990165.html