JDK version changes and new features

Table of contents

JDK version overview

        1、JDK1.1(1997)

        2、JDK 1.2(1998)

        3、JDK 1.3(2000)

        4、JDK 1.4(2002)

        5、JDK 1.5 (2004)

        6、JDK1.6(2006)

        7、JDK 1.7(2011)

        8、JDK 1.8 (2014)

        9、JDK 1.9(2017)

        10、JDK 10(2018)

        11、JDK 11(2018.9)

        12、JDK 12(2019)

        13、JDK 13(2019.9)

        14、JDK 14 (2020.3)

        15、JDK 15(2020.9)

        16、JDK 16 (2021.3)

        17、JDK 17 (2021.9)


JDK version overview

jdk version
serial number Version time
1 JDK 1.1 1997
2 JDK 1.2 1998
3 JDK 1.3 2000
4 JDK 1.4 2002
5 JDK 5.0 2004
6 JDK 6 2006
7 JDK 7 2011
8 JDK 8 2014
9 JDK 9 2017
10 JDK 10 2018
11 JDK 11 2018
12 JDK 12 2019
13 JDK 13 2019

14

JDK 14 2020
15 JDK 15 2020
16 JDK 16 2021
17 JDK 17 2021

1、JDK1.1(1997)

        JDK 1.1 (Java Development Kit 1.1) is the first official version of the Java platform, released in 1997. Although it was one of the initial versions of Java, it introduced relatively few new features compared to subsequent versions. Here are some new features and improvements in JDK 1.1 version:

  1. AWT (Abstract Window Toolkit):  JDK 1.1 introduced AWT, a graphical user interface (GUI) library for Java. AWT provides the function of creating GUI components such as windows, buttons, text boxes, etc., enabling Java applications to have graphical interfaces.
  2. Inner Classes: JDK 1.1 introduced inner classes, which allow one class to be defined inside another class . Inner classes have privileged access to outer class members, making it easier to implement encapsulation and componentization.
  3. JAR file format: JDK 1.1 introduced the JAR file format (Java Archive), which is used to package multiple Java class files and related resources into an executable JAR file . JAR files make it easy to distribute and deploy Java applications.
  4. Reflection: JDK 1.1 introduced the reflection mechanism, allowing programs to obtain class information, call methods and access fields at runtime . This provides the basis for the implementation of advanced features and tools such as JavaBeans.
  5. Garbage Collection: JDK 1.1 introduced a more efficient garbage collection algorithm to improve the performance and memory management of Java programs.

  6. JDBC (Java Database Connectivity): JDK 1.1 introduced JDBC, an API for Java to communicate with databases . JDBC allows Java applications to connect to different types of databases and execute SQL queries.

  7. RMI (Remote Method Invocation): JDK 1.1 introduced RMI, a mechanism for remotely invoking Java object methods . It allows Java objects in distributed systems to communicate with each other.

2、JDK 1.2(1998)

         JDK 1.2 (Java Development Kit 1.2), also known as Java 2, was released in 1998 and introduced many important new features and improvements that made the Java programming language more powerful and feature-rich. Here are some of the major new features in JDK 1.2 version:

  1. Swing GUI Library: JDK 1.2 introduced Swing, a new Java graphical user interface (GUI) library. Swing provides lightweight components that are more expressive and customizable than AWT. It introduces new components such as forms, buttons, labels, tables, etc. to provide a more modern look and feel to Java applications.

  2. Collections Framework: JDK 1.2 introduced the Collections Framework , which provides a set of classes and interfaces for operating and managing data collections. This includes data structures such as List, Set, and Map, making data operations more convenient and efficient.

  3. JDBC 2.0: Java Database Connectivity (JDBC) 2.0 introduces more features in JDK 1.2, including batch operations, connection pools, scrollable result sets , etc.

  4. Internalization (internationalization): JDK 1.2 introduced better support for internationalization. It introduces new internationalization and localization APIs so that developers can easily create multi-language and multi-region applications.

  5. Enhancement of reflection: The reflection mechanism has been enhanced in JDK 1.2, allowing developers to more easily obtain and operate class information, including methods, fields, annotations, etc.

  6. Casting: JDK 1.2 introduced casting, allowing developers to cast an object to another type for more flexible programming.

  7. Java Naming and Directory Interface (JNDI): JDK 1.2 introduced JNDI for finding and accessing naming and directory services such as LDAP (Lightweight Directory Access Protocol) in distributed environments.

  8. Reverse layout manager (LayoutManager): JDK 1.2 introduces more layout managers to enable developers to more flexibly manage the layout of Swing GUI components.

  9. Improved event handling: JDK 1.2 introduces more event handling capabilities, including internal event listeners, event adapters, etc.

  10. Java 2D API: JDK 1.2 introduced the Java 2D API, allowing developers to create 2D graphics and image processing applications.

  11. Pack200 compression of Jar files: JDK 1.2 introduced the Pack200 tool for more efficient compression of Jar files to reduce the download size of applications.

        The introduction of JDK 1.2 makes the Java platform more powerful and suitable for a wider range of application fields, including graphics applications, enterprise-level applications, database applications, etc. It marks the development process of Java and provides a solid foundation for subsequent versions of Java. 

3、JDK 1.3(2000)

        JDK 1.3 (Java Development Kit 1.3) was released in 2000 and introduced many new features and improvements to further enhance the functionality and performance of the Java programming language and platform. Here are some of the major new features and improvements in JDK 1.3 version:

  1. HotSpot Virtual Machine: JDK 1.3 introduced the HotSpot Virtual Machine, a high-performance Java virtual machine designed to improve the execution speed and memory management of Java applications . HotSpot virtual machine has been further optimized and improved in subsequent versions.

  2. Enhancements to Java Naming and Directory Interface (JNDI): JDK 1.3 extends JNDI, introducing more features to enable Java applications to more easily interact with naming and directory services.

  3. Java Platform Debugger Architecture (JPDA): JDK 1.3 introduced JPDA, an architecture for Java debugging. JPDA allows developers to use a debugger to inspect and debug the runtime state of Java applications.

  4. Java Sound API: JDK 1.3 introduced the Java Sound API, allowing developers to perform audio processing and playback in Java applications .

  5. Java Naming and Directory Interface for the Service Provider Interface (JNDI SPI): JDK 1.3 introduced JNDI SPI, a mechanism that extends JNDI, allowing developers to create custom JNDI providers to access various naming and directory services.

  6. Java Secure Socket Extension (JSSE): JDK 1.3 introduced JSSE to provide an API for encrypted and secure socket communication. It allows Java applications to communicate encrypted, ensuring data security and privacy.

  7. Java Authentication and Authorization Service (JAAS): JDK 1.3 introduced JAAS, an API for authentication and authorization . It allows developers to implement secure user authentication and access control.

  8. RMI-IIOP: JDK 1.3 introduced RMI-IIOP, an extension of RMI (Remote Method Invocation) that supports distributed communication using CORBA (Common Object Request Broker Architecture).

  9. Java Platform Debugger Architecture (JPDA): JDK 1.3 introduced JPDA, which provides a framework for Java program debugging, including Java Virtual Machine Tool Interface (JVMTI) and Java Virtual Machine Debugging Interface (JVMDI).

  10. Other improvements: JDK 1.3 also includes many other improvements, such as performance optimizations, bug fixes, new tools and APIs, etc., to improve the stability and usability of the Java platform.

        The introduction of JDK 1.3 further expands the capabilities of the Java platform, adding more tools and APIs for developing enterprise-class and distributed applications. These improvements make Java a more powerful, flexible, and reliable programming language and platform.

4、JDK 1.4(2002)

        JDK 1.4 (Java Development Kit 1.4), also known as Java 2 Platform, Standard Edition 1.4, was released in 2002 and introduced many new features and improvements to further enhance the functionality and performance of the Java programming language and platform. Here are some of the major new features and improvements in JDK 1.4 version:

  1. Regular Expressions: JDK 1.4 introduced regular expression support, java.util.regexproviding powerful regular expression functions through packages for text processing and pattern matching.

  2. Enhancements to the Collections Framework: JDK 1.4 extends the Collections Framework, introducing new collection classes such as LinkedHashMapand LinkedHashSet, as well as new methods in the Collections class such as Collections.sort.

  3. Exception Chaining: JDK 1.4 introduced exception chaining, which allows other exception information to be included in an exception to aid debugging and error handling.

  4. Assertions: JDK 1.4 introduced the assertion mechanism, allowing developers to insert assertion statements in the code to check the expected state of the program and throw AssertionErroran exception when the assertion fails.

  5. NIO (New I/O): JDK 1.4 introduces NIO, a new I/O (input/output) mechanism that provides more flexible and efficient file and network I/O operations.

  6. XML parsing: JDK 1.4 introduced built-in XML parsers such as javax.xml.parserspackages to facilitate processing and analysis of XML documents.

  7. Logging: JDK 1.4 introduced java.util.loggingpackages to implement basic logging functions, allowing developers to record application runtime information.

  8. Improvements in Casting: JDK 1.4 introduced generics and related casts, allowing for safer and type-safe programming.

  9. Java Web Start: JDK 1.4 introduced Java Web Start, a mechanism for launching and deploying Java applications, allowing applications to be launched from a web browser.

  10. Security improvements: JDK 1.4 introduces a number of security improvements, including an improved security manager and permissions model, to enhance the security of Java applications.

  11. JDBC 3.0: Java Database Connectivity (JDBC) 3.0 introduced new features in JDK 1.4, such as scrollable result sets, batch operations , etc.

  12. Improved performance: JDK 1.4 includes many performance optimizations, including garbage collection and JIT (Just-In-Time) compiler improvements, to improve the performance of Java applications .

  13. Other improvements: JDK 1.4 also includes many other improvements, such as added APIs, new tools, bug fixes, etc., to improve the stability and usability of the Java platform.

        The introduction of JDK 1.4 further enhances the functionality of the Java platform, making it more suitable for a variety of applications and fields, including enterprise applications, Web applications, desktop applications and embedded systems. These new features and improvements provide Java developers with more tools and capabilities to simplify development and improve performance.

 5、JDK 1.5 (2004)

         JDK 1.5, also known as Java 5 or Java 1.5, was released in 2004 and introduced many important new features and language enhancements that made the Java programming language more powerful and expressive. Here are some of the major new features and improvements in JDK 1.5 version: 

  1.  Generics: Generics introduce type parameters, allowing developers to write more general, type-safe code. It allows the use of type parameters in collections, classes and methods, improving code readability and safety.
    List<String> names = new ArrayList<>();
    names.add("Alice");
    names.add("Bob");
    
  2. Enhanced forloops: JDK 1.5 introduced enhanced forloops, also known as foreach loops, for traversing collections and arrays.
    for (String name : names) {
        System.out.println(name);
    }
    
  3.  Autoboxing and Unboxing: JDK 1.5 introduced autoboxing and unboxing, allowing implicit conversions between primitive data types and their corresponding wrapper classes.
    Integer i = 42; // 自动装箱
    int j = i;      // 自动拆箱
    
  4. Enums: JDK 1.5 introduced enumeration types, allowing developers to create enumeration types with fixed constant values.
    enum Day {
        MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY
    }
  5. Static Import: Static import allows developers to use static members directly in the code without using class name qualifiers.
    import static java.lang.Math.*;
    double result = sqrt(25.0);
  6. Variable parameters (Varargs): JDK 1.5 introduced variable parameters, allowing methods to accept an indefinite number of parameters, simplifying the definition and calling of methods.
    public void printNumbers(int... numbers) {
        for (int num : numbers) {
            System.out.println(num);
        }
    }
  7. Annotations: Annotations allow developers to add metadata information to the code for compile-time and run-time processing. Java 5 introduced custom annotations and meta-annotations (used to annotate other annotations).
    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.METHOD)
    public @interface MyAnnotation {
        String value();
    }
  8. Enumeration collections (EnumSet and EnumMap): JDK 1.5 introduced EnumSet and EnumMap, these collection classes are specifically designed to handle enumeration types .

  9. Formatted Strings:printf The and formatmethods are introduced , as well as String.formatfor more flexible formatting of strings.

    System.out.printf("Hello, %s! You are %d years old.%n", name, age);
  10. Concurrent Utilities: JDK 1.5 introduced java.util.concurrentpackages that provide concurrent programming tools, such as locks, thread pools, concurrent collections, etc.

        These new features and language enhancements make Java programming easier, safer, and more efficient. They provide Java developers with more tools and technologies to address the needs of a variety of applications, from simple scripts to large-scale enterprise applications.

6、JDK1.6(2006)

        JDK 1.6 (also known as Java 6 or Java SE 6) was released in 2006 and introduced many new features, improvements, and performance optimizations. Here are some of the major new features and improvements in JDK 1.6 version:

  1. Scripting Engine: JDK 1.6 introduced the Java Compiler API and related scripting engine API, allowing scripting languages, such as JavaScript, Groovy and other scripting languages, to be embedded and executed in Java applications .

  2. Pluggable Annotations: JDK 1.6 introduced the pluggable annotation processor API, allowing developers to create custom annotation processors for generating code, verifying code, or performing other annotation-related tasks.

  3. Desktop application enhancements: JDK 1.6 introduces many improvements, including support for the system tray, improved AWT and Swing components , better platform integration, etc., making it easier to develop desktop applications.

  4. Performance optimization: JDK 1.6 includes performance optimizations for the Java Virtual Machine (JVM), including an improved JIT compiler, improvements to the garbage collector, etc., to improve the performance and response speed of Java applications.

  5. Web services enhancements: JDK 1.6 introduces JAX-WS (Java API for XML Web Services) 2.0 for developing and deploying web service applications.

  6. JDBC 4.0: Java Database Connectivity (JDBC) 4.0 was introduced in JDK 1.6, including automatic loading of database drivers, simpler connection management, more SQL type support, etc.

  7. XML support: JDK 1.6 has enhanced XML processing capabilities, including a built-in XML parser, improved XPath and XSLT support, etc.

  8. JConsole monitoring tool: JDK 1.6 introduces JConsole, a tool for monitoring and managing Java applications, allowing developers to monitor heap memory, threads, performance and other information .

  9. Improved garbage collection: JDK 1.6 includes improved garbage collection algorithms, such as the G1 (Garbage-First) garbage collector, to improve the efficiency and performance of memory management.

  10. Java Compiler API: JDK 1.6 introduced the Java Compiler API, which allows developers to dynamically compile Java source code at runtime and load it into the JVM for execution.

        These new features and improvements make Java 6 a more powerful, efficient, and easier platform to develop and maintain. It provides Java developers with more tools and technologies to meet changing application needs. In addition, JDK 1.6 is an LTS (Long Term Support) version, providing longer-term support and maintenance.

 7、JDK 1.7(2011)

        JDK 1.7 (also known as Java 7 or Java SE 7) was released in 2011 and introduced many new features, improvements, and performance optimizations. Here are some of the major new features and improvements in JDK 1.7 version:

  1. Language Enhancements:

    1. Diamond Operator: Allows generic types to be omitted when instantiating generic classes, making the code more concise.

    2. String type switch statement: Strings are allowed to be used in switch statements.

    3. Automatic Resource Management: The try-with-resources statement is introduced to automatically close resources, such as files, network connections, etc.

    4. Multiple Exception Handling: Allows capturing multiple exception types in one catch block.

  2. NIO 2.0 (New I/O): NIO 2.0 is introduced, adding support for file system operations, including file copy, move, delete, etc.
  3. Fork/Join framework: The Fork/Join framework is introduced for parallel processing tasks, especially suitable for multi-core processors.

  4. Dynamic Language Support: The InvokeDynamic instruction is introduced to support runtime optimization of dynamic languages.

  5. New Garbage Collectors: The G1 (Garbage-First) garbage collector is introduced to provide better garbage collection performance and predictability.

  6. Concurrent Collections: Introduces concurrent collections, such as ConcurrentHashMap, to support multi-threaded concurrent access.

  7. Annotations Enhancements: Allow annotations to be used for more program elements, such as local variables, constructors, method exception declarations, etc.

  8. New I/O and NIO classes: New I/O and NIO classes are introduced, such as file system operation classes (Files class), asynchronous channel classes (AsynchronousChannel), socket option classes, etc.

  9. Improved concurrency tools: New concurrency tools such as CountDownLatch, Phaser, Exchanger, etc. have been introduced to simplify multi-threaded programming.

  10. Support for new hardware architectures: JDK 1.7 adds support for new hardware architectures, including new instruction set extensions and hardware acceleration.

  11. Improved network library: JDK 1.7 introduces improvements to NIO 2.0, supporting non-blocking I/O, new network protocols, etc.

  12. Java Virtual Machine (JVM) performance optimization: JDK 1.7 includes several improvements to JVM performance to improve application performance and responsiveness.

  13. Upgraded JDBC: Introducing JDBC 4.1, including more automation features and improvements.

  14. Improved security: JDK 1.7 enhances Java's security, including new encryption algorithms and security enhancements.

         These new features and improvements make Java 7 a more powerful, efficient, and easier platform to develop and maintain. It provides Java developers with more tools and technologies to meet changing application needs and provide better performance and security.

8、JDK 1.8 (2014)

        Released in 2014, JDK 1.8 (also known as Java 8) introduced many important new features, improvements, and language enhancements that made the Java programming language more modern, powerful, and efficient. Here are some of the major new features and improvements in JDK 1.8 version:

  1. Lambda Expressions: Lambda expressions are introduced, allowing developers to write anonymous functions in a more compact and clear way, making it easier to implement functional programming.
    List<String> names = Arrays.asList("Alice", "Bob", "Charlie");
    names.forEach(name -> System.out.println(name));
  2. Functional Interfaces: JDK 1.8 introduced the functional interface, which is an interface with only one abstract method to support the use of Lambda expressions.
    @FunctionalInterface
    interface MyFunction {
        int apply(int a, int b);
    }
  3. Stream API: Introduced Stream API, a functional programming way to handle collection data. Stream allows filtering, mapping, reduction and other operations.
    List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
    int sum = numbers.stream().filter(n -> n % 2 == 0).mapToInt(Integer::intValue).sum();
  4. Default Methods: Allows adding methods with default implementations to the interface so that the interface can be extended without breaking the existing implementation.
    interface MyInterface {
        void myMethod();
        default void myDefaultMethod() {
            // 默认实现
        }
    }
  5. Method References: Allows using existing methods as parameters of Lambda expressions to simplify code.
    List<String> names = Arrays.asList("Alice", "Bob", "Charlie");
    names.forEach(System.out::println);
  6. New Date and Time API: Introduced java.timepackages that provide better date and time processing capabilities, including immutable date and time objects, time zone support, etc.
    LocalDate today = LocalDate.now();
  7. New JavaScript engine: Introduced Nashorn JavaScript engine for executing JavaScript code in Java applications.
  8. Improved Annotations: Duplicate annotations and type annotations are introduced to enhance the flexibility of annotations.

  9. New concurrency tools: Introduced CompletableFutureclasses for easier asynchronous programming and parallel processing.

  10. Improved Garbage Collection: Improvements to the G1 garbage collector have been introduced to improve garbage collection performance.

  11. Improved type inference: Target type inference is introduced to allow the compiler to better understand the target type of a lambda expression.

  12. Other improvements: including new functional interfaces, improved interface default method support, new methods and classes, new IO/NIO2 functions, security enhancements, etc.

        The introduction of JDK 1.8 modernizes the Java programming language, providing more tools and language features to support functional programming and cleaner code writing, while maintaining the stability and reliability of Java. These new features make Java 8 a more powerful platform better suited to modern development needs.

9、JDK 1.9(2017)

        JDK 1.9 (also known as Java 9) was released in 2017 and introduced some important new features, improvements and language enhancements, as well as major changes to the modular system. Here are some of the major new features and improvements in JDK 1.9 version:

  1. Module System: JDK 9 introduced the module system to organize code into modules to better manage and resolve dependencies. This helps reduce classpath issues and improves code maintainability and scalability.

  2. Modularized Standard Library: JDK 9 divides the Java standard library into modules, allowing developers to more accurately select the modules they need and reducing application dependencies.

  3. Private Methods in Interfaces: Allows private methods to be defined in interfaces to implement public methods in the interface, improving the maintainability and code reusability of the interface.

    interface MyInterface {
        default void myDefaultMethod() {
            // 公共方法
            privateMethod();
        }
        
        private void privateMethod() {
            // 私有方法
        }
    }
  4. Improved Diamond Operator: Allows the use of diamond operators in anonymous classes.

    List<String> names = new ArrayList<>();
  5. Improved try-with-resourcesstatements: Allow try-with-resourcesdeclared resources to be used in statements.

    Resource resource1 = new Resource();
    Resource resource2 = new Resource();
    try (resource1; resource2) {
        // 使用资源
    }
  6. Improved @SafeVarargsannotations:@SafeVarargs Allow annotations in private static methods .

  7. Improved Performance and Garbage Collectors: JDK 9 includes performance improvements and optimizations for the G1 garbage collector.

  8. HTTP 2 Client: The new HTTP 2 Client API is introduced, allowing developers to handle HTTP requests and responses more efficiently.

  9. Collection Factory Methods: Introduced some new factory methods for creating immutable collection objects, such as List.of()and Set.of().

    List<String> names = List.of("Alice", "Bob", "Charlie");
  10. New command line tools (Command Line Tools): A new set of command line tools are introduced for source code analysis, module management, javadoc generation, etc.

  11. Improved javadocTools: Improved documentation generation tools with the introduction of new HTML5 support, search functionality, and other improvements.

  12. Improved javaccompiler: Several compiler improvements have been introduced to improve the performance and stability of your code.

        These new features and improvements make JDK 9 a more modern and powerful Java platform, while introducing a modular system to improve code maintainability and dependency management. It should be noted that the introduction of the module system may require developers to make some adjustments to adapt to the new modular programming approach.

10、JDK 10(2018)

        JDK 10 (also known as Java 10) was released in 2018, and while it introduced relatively few new features and improvements compared to previous versions, it still included some interesting features. Here are some of the major new features and improvements in the JDK 10 version:

  1. Local Variable Type Inference: The keyword is introduced varto allow the use of type inference in the declaration of local variables, reducing redundant type declarations.
    var name = "Alice"; // 推断出String类型
  2. Improved Optionalclasses: Some new methods have been introduced, such as orElseThrow(), to improve Optionalthe usefulness of the class.
    Optional<String> name = Optional.ofNullable(null);
    name.orElseThrow(() -> new IllegalArgumentException("Name not found"));
  3. Improved CompletableFutureclasses: New methods such as completeAsync()and are introduced orTimeout()to support more flexible asynchronous programming.
    CompletableFuture<Integer> future = CompletableFuture.supplyAsync(() -> 42);
    future.completeAsync(() -> 42, executor);
  4. javapCommand improvements: Introduced -land -poptions for displaying local variable tables and non-public class members.
    javap -l MyClass
    javap -p MyClass
  5. Improved garbage collector: JDK 10 includes some garbage collector improvements, such as performance optimizations for the G1 garbage collector.

  6. Application Class-Data Sharing (AppCDS): Allows application class metadata to be shared to improve the performance of launching and executing applications.

  7. Thread-Local Handshakes: Introduces a lightweight thread-local handshake mechanism to reduce global lock competition and improve the performance of multi-threaded applications.

        Although these new features and improvements are not as significant as some of the content introduced in previous versions, they still help improve Java's readability, performance, and development experience. Local variable type inference is an interesting feature that can reduce redundant type declarations and make code cleaner. Additionally, an improved garbage collector and asynchronous programming tools give developers more tools to optimize application performance.

11、JDK 11(2018.9)

        JDK 11 was released in September 2018. It is an LTS (Long-Term Support) version that provides long-term support. The following are some of the major new features and improvements of the JDK 11 version:

  1. HTTP Client: Introduces a standardized HTTP client API, supports HTTP/1.1 and HTTP/2, and provides support for asynchronous and synchronous requests.
    HttpClient httpClient = HttpClient.newHttpClient();
    HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://example.com"))
            .GET()
            .build();
    HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
  2. Local variable syntax improvements: Improvements to local variable syntax have been introduced, allowing varvariables to be initialized at the same time as they are declared.
    var name = "Alice"; // 自动推断为String类型
  3. New Garbage Collector: The Epsilon garbage collector is introduced, which is a garbage collector that does not perform garbage collection operations and is used for performance testing and special scenarios.

  4. Improvements to unit testing tools: A new unit testing tool, JEP 320, has been introduced to make unit tests easier to write and run.

  5. Dynamic Class-File Constants: New bytecode instructions are introduced to allow runtime access to constants in the class file constant pool.

  6. ZGC Garbage Collector Stable Version (Z Garbage Collector): The ZGC Garbage Collector has been converted from an experimental feature to a stable version for garbage collection of large heaps of memory.

  7. Flight Recorder: Introducing an open source version of the Flight Recorder tool, allowing developers to collect performance data in production environments.

  8. New command line tools: Some new command line tools have been introduced, such as jhsdb(Java HotSpot Debugger) and jfr(Java Flight Recorder).

  9. Elasticsearch Connector: Introduced a new API for connecting to Elasticsearch to facilitate Java applications accessing Elasticsearch clusters.

  10. Other improvements: JDK 11 also includes many other improvements, such as improvements to security, performance, performance monitoring tools and libraries.

        These new features and improvements make JDK 11 a more stable, powerful, and secure version, especially due to its LTS nature, making it a long-term support option for applications that require stability and maintainability.

 12、JDK 12(2019)

        JDK 12 was released in 2019 as a short-term support version (non-LTS). Compared with previous LTS versions, it introduced relatively few new features. Here are some of the major new features and improvements in the JDK 12 release:

  1. Switch Expressions: Introduces new switchexpressions that allow switchstatements to be used as expressions, thereby reducing redundant code.
    int day = 2;
    String dayType = switch (day) {
        case 1, 2, 3, 4, 5 -> "Weekday";
        case 6, 7 -> "Weekend";
        default -> "Invalid";
    };
  2. Compact Number Formatting: Introduces a new API for more compact formatting of numbers, especially for internationalization.
    NumberFormat cf = NumberFormat.getCompactNumberInstance(Locale.US, NumberFormat.Style.SHORT);
    String formatted = cf.format(1000);
  3. New Garbage Collector: A new garbage collector, named Garbage Collector, is introduced Shenandoah, designed to reduce garbage collection pause times.

  4. Microbenchmarking: Introduces Microbenchmark Suitetools for microbenchmark testing to help developers optimize performance.

  5. Introducing preview features: JDK 12 introduces some preview features, such as Switchexpressions and compact number formatting, which are experimental and available for developers to try.

  6. Other improvements: JDK 12 also includes some performance improvements, new command line tools, removal of deprecated features and some library improvements.

        It should be noted that since JDK 12 is a short-term support release, its main goal is to experiment and introduce new features rather than provide long-term support. Therefore, some new features may be stabilized in subsequent LTS releases, while other features may be improved or removed. Developers should carefully consider whether to use JDK 12, especially in a production environment.

13、JDK 13(2019.9)

        Released in September 2019, JDK 13 is a non-LTS (non-long-term support) version that introduces several new features, improvements, and experimental features. Here are some of the major new features and improvements in the JDK 13 release:

  1. Switch expression enhancements: Expressions introduced in JDK 12 switchare further enhanced in JDK 13 to allow the use of yieldkeywords to return values.
    int result = switch (day) {
        case 1, 2, 3, 4, 5 -> {
            System.out.println("Weekday");
            yield 42;
        }
        case 6, 7 -> {
            System.out.println("Weekend");
            yield 0;
        }
        default -> throw new IllegalArgumentException("Invalid");
    };
  2. New string methods: Some new string methods are introduced, such as String::strip(), String::stripLeading(), String::stripTrailing(), to remove whitespace characters from strings.
    String text = "   Hello, World!   ";
    String stripped = text.strip();
  3. Improvements to the ZGC garbage collector: The ZGC garbage collector has some performance and functionality improvements in JDK 13.

  4. Text Blocks Standardization: Introduces the standardization feature of text blocks, allowing for easier writing of multiple lines of text in code.

    String html = """
        <html>
            <body>
                <p>Hello, World!</p>
            </body>
        </html>
        """;
  5. Unix Domain Socket Support: Support for Unix Domain Sockets has been introduced on Unix systems for local inter-process communication.

  6. New command line tools: Some new command line tools have been introduced, such as jshell(Interactive Java Shell) improvements and the new jfr(Java Flight Recorder) tool.

  7. Removal of deprecated features: Some deprecated APIs and functions have been removed in JDK 13 to maintain the simplicity and stability of the platform.

  8. Other improvements: JDK 13 also includes several performance improvements, JVM improvements, and other library improvements.

        Since JDK 13 is a non-LTS release, its goal is to introduce new experimental features and improvements rather than provide long-term support. Therefore, use in production environments requires careful consideration and may require code migration in subsequent LTS releases. Developers should decide whether to adopt JDK 13 based on the needs and lifecycle of their projects.

14、JDK 14 (2020.3)

        JDK 14 was released in March 2020, and it introduced several new features, improvements, and experimental features. Here are some of the major new features and improvements in the JDK 14 release:

  1. Switch expression enhancements: Expressions introduced in JDK 12 and 13 switchare further enhanced in JDK 14 to allow the use of multiple label constants.
    int result = switch (day) {
        case 1, 2, 3, 4, 5 -> {
            System.out.println("Weekday");
            yield 42;
        }
        case 6, 7 -> {
            System.out.println("Weekend");
            yield 0;
        }
        default -> throw new IllegalArgumentException("Invalid");
    };
  2. Records (record class): Introduces the record class, a new class type used to declare immutable, automatically implemented equals(), hashCode()and toString()other methods of data objects.
    record Point(int x, int y) { }
  3. Pattern Matching for instanceof: Pattern matching is introduced for instanceofoperators to make the code more concise.
    if (obj instanceof String s) {
        // 在此作用域中可以使用s
    }
  4. Text Blocks improvements: Improved handling of text blocks, allowing expressions to be inserted within text blocks.
    String formatted = """
        Hello, %s!
        Your balance is $%,.2f.
        """.formatted(name, balance);
  5. Garbage collector improvements: JDK 14 includes a number of garbage collector improvements, specifically performance and stability improvements to the G1 garbage collector.

  6. External library support improvements: New versions of some external libraries, such as OpenJFX 14, have been introduced to provide better graphical user interface (GUI) support.

  7. JFR Event Streaming: The JFR event stream output function is introduced, allowing streaming of JFR event data at runtime.

  8. Foreign Function & Memory API (Incubator): Introduces an incubated version of the Foreign Function & Memory API for interacting with native code and memory.

  9. Other improvements: JDK 14 also includes some performance improvements, removal of deprecated features, and some library improvements.

        It is important to note that some features in JDK 14 may be in the experimental stage (for example, Records and Pattern Matching for instanceof), which means that they may be further improved in subsequent versions or officially become part of Java. Developers can consider whether to adopt JDK 14 based on project needs and long-term plans.

15、JDK 15(2020.9)

        JDK 15 was released in September 2020, and it introduced several new features, improvements, and experimental features. Here are some of the major new features and improvements in the JDK 15 release:

  1. Sealed Classes: Sealed classes are introduced, a new class type that allows a class to explicitly specify the subclasses it is allowed to inherit from.
    sealed class Shape permits Circle, Rectangle, Triangle {
        // ...
    }
  2. Text Blocks enhancements: The syntax of text blocks has been further enhanced to allow backslashes to be included in text blocks.
    String json = """
        {
            "name": "John",
            "age": 30,
            "city": "New York"
        }
        """;
  3. External library improvements: New versions of external libraries, such as OpenJFX 15, have been introduced to provide better graphical user interface (GUI) support.

  4. Garbage collector improvements: JDK 15 includes a number of garbage collector improvements, specifically performance and stability improvements to the G1 garbage collector.

  5. Unix Domain Socket Channel: Introduced support for Unix Socket Channels for native inter-process communication on Unix systems.

  6. Remove Applets: Removed the Applet API, an obsolete browser plug-in technology.

  7. Other improvements: JDK 15 also includes some performance improvements, removal of deprecated features and some library improvements.

        It is important to note that some features in JDK 15 may be in the experimental stage, while other features may be further improved in future versions or officially become part of Java. Developers can consider whether to adopt JDK 15 based on project needs and long-term plans. In addition, JDK 15 is a non-LTS (non-long-term support) version, so long-term support will not be provided, and developers may need to migrate code on subsequent LTS versions.

16、JDK 16 (2021.3)

        JDK 16 was released in March 2021, and it introduced several new functions, improvements, and experimental features. Here are some of the major new features and improvements in the JDK 16 release:

  1. Unix Domain Socket Channel API: Introduced formal API support for Unix Domain Socket channels for local inter-process communication.

  2. Vector API (Incubator): Introduces an incubator version of the Vector API, allowing developers to more easily perform parallel computing.

  3. Removed features: Some deprecated features and modules have been removed in JDK 16, such as the RMI Activation system and Applet API.

  4. Alpine Linux support: Introduced official support for Alpine Linux, allowing Java to better run in Docker containers.

  5. Garbage collector improvements: JDK 16 includes a number of garbage collector improvements, specifically performance and stability improvements to the G1 garbage collector.

  6. Pattern Matching for instanceof(Preview):instanceof Improved support for pattern matching , including instanceofwhen used in pattern matching.

  7. Record class enhancement (Preview): More features are introduced in the record class, such as nested record classes and pattern matching of record classes.

  8. Foreign Function & Memory API (Incubator): Introduces improvements to the incubator version of the Foreign Function and Memory API to support more low-level interactive operations.

  9. Other improvements: JDK 16 also includes some performance improvements, removal of deprecated features, and some library improvements.

        It is important to note that some features are in the incubation or preview stage, which means they may be further improved in subsequent releases or officially become part of Java. Developers can consider whether to adopt JDK 16 based on project needs and long-term plans. Since JDK 16 is not an LTS version, the support period it provides is relatively short, and developers may need to migrate code on subsequent versions.

17、JDK 17 (2021.9)

         JDK 17 was released in September 2021 and is an LTS (long-term support) version that provides long-term support and maintenance. Here are some of the major new features and improvements in the JDK 17 release:

  1. Garbage collector improvements: JDK 17 includes a number of garbage collector improvements, specifically performance and stability improvements to the G1 garbage collector.

  2. Further enhancements to Sealed Classes: In JDK 17, Sealed Classes can extend known subclasses, not just declared subclasses.

  3. Official version of pattern matching: Pattern matching became official in JDK 17, including pattern matching for instanceofpattern matching switchexpressions.

    if (obj instanceof String s) {
        // 在此作用域中可以使用s
    }
    
    int result = switch (day) {
        case 1, 2, 3, 4, 5 -> {
            System.out.println("Weekday");
            yield 42;
        }
        case 6, 7 -> {
            System.out.println("Weekend");
            yield 0;
        }
        default -> throw new IllegalArgumentException("Invalid");
    };
  4. External library and module improvements: JDK 17 introduces new versions of some external libraries and improves some modules.

  5. Alpine Linux support improvements: Support on Alpine Linux has been further improved to improve performance and usability of running Java in Docker containers.

  6. Removed features: Some deprecated features and modules have been removed in JDK 17, such as the RMI Activation system and Applet API.

  7. Other improvements: JDK 17 also includes some performance improvements, removal of deprecated features, and some library improvements.

        Since JDK 17 is an LTS version, it provides a relatively long support and maintenance cycle, suitable for applications and projects that require long-term stability and reliability. Developers can consider adopting JDK 17 based on project needs and long-term plans, especially for enterprise and large-scale applications.

Guess you like

Origin blog.csdn.net/Deikey/article/details/132663692
Recommended