Java Platform, Standard Edition Oracle JDK Migration Guide
Total Page:16
File Type:pdf, Size:1020Kb
Java Platform, Standard Edition Oracle JDK Migration Guide Release 16 F40378-01 March 2021 Java Platform, Standard Edition Oracle JDK Migration Guide, Release 16 F40378-01 Copyright © 2017, 2021, Oracle and/or its affiliates. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government’s use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government. This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group. This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle. Contents Preface Audience vi Documentation Accessibility vi Related Documents vi Conventions vi 1 Getting Started 2 Significant Changes in the JDK Significant Changes in JDK 16 Release 2-1 Significant Changes in JDK 15 Release 2-2 Significant Changes in JDK 14 Release 2-3 Significant Changes in JDK 13 Release 2-4 Significant Changes in JDK 12 Release 2-5 Significant Changes in JDK 11 Release 2-5 3 Security Updates Security Updates in JDK 16 3-1 Security Updates in JDK 15 3-1 Security Updates in JDK 14 3-1 Security Updates in JDK 13 3-1 Security Updates in JDK 11 and JDK 12 3-2 Security Updates in JDK 9 and JDK 10 3-2 JCE Jurisdiction Policy File Default is Unlimited 3-2 Create PKCS12 Keystores 3-3 4 Removed APIs API Removed in Java SE 16 4-1 APIs Removed in Java SE 15 4-1 iii APIs Removed in Java SE 14 4-1 APIs Removed in Java SE 13 4-2 APIs Removed in Java SE 12 4-2 APIs Removed in JDK 11 4-2 APIs Removed in JDK 10 4-3 APIs Removed JDK 9 4-3 Removed java.* APIs 4-3 Removal and Future Removal of sun.misc and sun.reflect APIs 4-3 java.awt.peer Not Accessible 4-4 Removed com.sun.image.codec.jpeg Package 4-4 Removed Tools Support for Compact Profiles 4-5 Use CLDR Locale Data by Default 4-5 5 Removed Tools and Components Tools and Components Removed in JDK 16 5-1 Tools and Components Removed and Deprecated in JDK 15 5-2 Features and Components Removed in JDK 14 5-2 Tools and Components Removed in JDK 13 5-2 Tools and Components Removed in JDK 12 5-3 Tools and Components Removed in JDK 11 5-3 Tools and Components Removed in JDK 9 and JDK 10 5-5 Removed Native-Header Generation Tool (javah) 5-5 Removed JavaDB 5-5 Removed the JVM TI hprof Agent 5-5 Removed the jhat Tool 5-6 Removed java-rmi.exe and java-rmi.cgi Launchers 5-6 Removed Support for the IIOP Transport from the JMX RMIConnector 5-6 Dropped Windows 32–bit Client VM 5-6 Removed Java VisualVM 5-6 Removed native2ascii Tool 5-7 6 Preparing For Migration Download the Latest JDK 6-1 Run Your Program Before Recompiling 6-1 Update Third-Party Libraries 6-2 Compile Your Application if Needed 6-2 Run jdeps on Your Code 6-3 iv 7 Migrating From JDK 8 to Later JDK Releases Illegal Reflective Access 7-1 --add-exports 7-2 --add-opens 7-3 New Version-String Scheme 7-4 Changes to the Installed JDK/JRE Image 7-4 Changed JDK and JRE Layout 7-5 New Class Loader Implementations 7-5 Removed rt.jar and tools.jar 7-6 Removed Extension Mechanism 7-7 Removed Endorsed Standards Override Mechanism 7-7 Removed macOS-Specific Features 7-8 Platform-Specific Desktop Features 7-8 Removed AppleScript Engine 7-8 Windows Registry Key Changes 7-8 Deployment 7-9 Removed Launch-Time JRE Version Selection 7-9 Removed Support for Serialized Applets 7-9 JNLP Specification Update 7-9 Changes to Garbage Collection 7-10 Make G1 the Default Garbage Collector 7-10 Removed GC Options 7-10 Changes to GC Log Output 7-11 8 Next Steps v Preface Preface The purpose of this guide is to help you identify potential issues and give you suggestions on how to proceed as you migrate your existing Java application to JDK 16. Audience This guide is intended for experienced users of the Java language, such as systems administrators and software developers, for whom the performance of the Java platform and their applications is of vital importance. Documentation Accessibility For information about Oracle's commitment to accessibility, visit the Oracle Accessibility Program website at http://www.oracle.com/pls/topic/lookup? ctx=acc&id=docacc. Access to Oracle Support Oracle customers that have purchased support have access to electronic support through My Oracle Support. For information, visit http://www.oracle.com/pls/topic/ lookup?ctx=acc&id=info or visit http://www.oracle.com/pls/topic/lookup?ctx=acc&id=trs if you are hearing impaired. Related Documents See JDK 16 Documentation for other JDK 16 guides. Conventions The following text conventions are used in this document: Convention Meaning boldface Boldface type indicates graphical user interface elements associated with an action, or terms defined in text or the glossary. italic Italic type indicates book titles, emphasis, or placeholder variables for which you supply particular values. monospace Monospace type indicates commands within a paragraph, URLs, code in examples, text that appears on the screen, or text that you enter. vi 1 Getting Started The guide highlights the significant changes and enhancements done in JDK 16. This guide contains the following sections: • Significant Changes in the JDK • Security Updates • Removed APIs • Removed Tools and Components • Preparing For Migration • Migrating From JDK 8 to Later JDK Releases • Next Steps Note: • Check the Oracle JDK Certified System Configurations for the latest supported platforms and operating system versions. • See Removed APIs, Tools, and Components before you start the migration process. 1-1 2 Significant Changes in the JDK Before migrating your application to the latest JDK release, you must understand what the updates and changes are between it and the previous JDK release. If you are migrating from JDK 8, you should also be familiar with the differences between JDK 8 and later releases that are described in Migrating From JDK 8 to Later JDK Releases. See the following sections to learn about some of the significant changes in latest JDK releases. Significant Changes in JDK 16 Release See JDK 16 Release Notes for additional descriptions of the new features and enhancements, and API specification in JDK 16. The following are some of the updates in Java SE 16 and JDK 16: • The Java programming language is enhanced with pattern matching for the instanceof operator.