JDK manufacturer open source JDK OpenJDK JDK installation Java installation JDK version difference difference between Java versions Java8 to Java17 changes jdk8 to jdk17 changes

1. JDK manufacturer

2. JDK installation (example is JDK 8)

Official installation documentation

https://docs.oracle.com/javase/8/docs/technotes/guides/install/windows_jdk_install.html#CHDEBCCJ

2.1. Download the JDK8 installation package

Download address , Oracle official website JDK requires login

Choose to download according to your computer system
Insert image description here

If you don’t have an account, you can use the JDK8 installation package I downloaded ( 包含中文文档) 123 network disk. You don’t need to log in to download the network disk.
Insert image description here

Double-click the jdk installer to install.
Insert image description here
Select all three packages to install.
Insert image description here

Insert image description here
Just keep clicking next step.

2.2. Environment variable configuration

2.2.1. Configure JAVA_HOME environment variable

Open environment variable settings > Create new environment variable JAVA_HOME

Variable name: JAVA_HOME
Variable value:jdk安装目录; 变量值是自己的jdk安装目录:例如:D:\JDK\jdk1.8.0_161

Insert image description here

2.2.2. Configure CLASSPATH environment variable

Open environment variable settings > Create new environment variable CLASSPATH

Variable name: CLASSPATH
Variable value:.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar

Insert image description here

2.2.3. Configure Path environment variable

Open the environment variable settings > find Pathand edit this environment variable

Insert image description here

Create a new environment variable value.
Variable value: %JAVA_HOME%\bin
Insert image description here
Pay special attention here. The win10 environment variable value is a whole line, not line by line like Win11. The added Pathvariable value in win10 %JAVA_HOME%\bin;has an extra ;trailing semicolon .

Finally test whether the installation is successful

Open CMD and run. java -versionIf the version number appears, the installation is successful.
Insert image description here

3. Changes from Java8 to Java17

JDK 8:

Main upgrade contents:

  • Lambda expression: supports functional programming.
  • Functional interface: Introduction of Function, Predicate, Consumer and other interfaces.
  • Stream: Functional streaming operations for processing collection data.
  • New date and time API: The java.time package is introduced to provide better date and time processing.
  • Default methods: Allows defining default implementations in interfaces.
  • New garbage collector: such as G1 collector, etc.
  • Nashorn JavaScript engine: used to run JavaScript code in Java.

Content removed:

  • PermGen and associated garbage collectors: replaced by Metaspace.

JDK 9:

Main upgrade contents:

  • Modular system (Jigsaw project): The concept of modularity is introduced and a module system is added.
  • Interface private methods: Allows defining private methods in the interface.
  • Improved Javadoc: The Javadoc tool has been improved to provide a better documentation generation experience.
  • New garbage collector: such as G1 collector, etc.

JDK 10:

Main upgrade contents:

  • Local variable type inference: Allows the use of the var keyword in the declaration of local variables for type inference.
  • Parallel full garbage collector: Improved performance of parallel GC.
  • Application Class Data Sharing: Improves the speed of application startup.

JDK 11:

Main upgrade contents:

  • HTTP client standard API: The standard HTTP client API is introduced.
  • Local variable syntax enhancement: allows the use of the var keyword in Lambda expressions for type inference.
  • Nested Access Control: Added some new access control modifiers.
  • ZGC Garbage Collector: Introduces a low-latency garbage collector.

JDK 12:

Main upgrade contents:

  • Switch expression: Enhanced the writing method of Switch statement.
  • New garbage collector (Shenandoah collector): A low-latency garbage collector is introduced.

JDK 13:

Main upgrade contents:

  • Text Blocks: Simplifies the way to write multi-line strings.
  • Switch expression improvements: The functionality of Switch expressions has been further enhanced.
  • Dynamic CDS (Class Data Sharing): Improves the speed of application startup.

JDK 14:

Main upgrade contents:

  • JEP343 (Garbage Collector Interface): Defines the interface of the garbage collector.
  • JEP345 (Prophet): Used to predict future data based on historical data.
  • JEP359 (Record Types): Introduces a new data type for quickly defining immutable data classes.

JDK 15:

Main upgrade contents:

  • Hidden Classes: Used to improve the performance of dynamic languages.
  • Sealed Classes: Restrict class inheritance.
  • GC's Epsilon collector: a no-op garbage collector.

JDK 16:

Main upgrade contents:

  • Record types (Records): Simplified the definition of data classes.
  • Pattern Matching: Enhanced pattern matching function of Switch expression.
  • Garbage Collector (ZGC, Shenandoah): Improved garbage collector performance and efficiency.

JDK 17:

Main upgrade contents:

  • Sealed Classes: Enhanced the flexibility of Sealed Classes.
  • Pattern Matching: Pattern matching functionality has been further improved.
  • Garbage Collector (ZGC, Shenandoah): Further improvements to the performance and efficiency of the garbage collector.

Guess you like

Origin blog.csdn.net/qq_40739917/article/details/132914519