The Java JDK (Java Development Kit) is a software development environment used for developing Java applications and applets. It's a package that includes the JRE, an interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator (javadoc), and other tools needed in Java development. In simple terms, the JDK provides the tools you need to write and run Java programs.

The full version string for this update release is 18.0.2+9 (where "+" means "build"). The version number is 18.0.1.1.

For full information and terms, refer to the OTN License Agreement for Java SE. The OTN License Agreement for Java SE for current Oracle Java SE releases allows them to be used, without cost:

  • (i) For personal use on a desktop or laptop computer, such as to play games or run other personal applications.
  • (ii) For development, testing, prototyping, and demonstrating applications, including to use by/with profilers, debuggers, and Integrated Development Environment tools.
  • (iii) For use with some approved products, such as Oracle SQL Developer, or as an end user of a software application created by an approved product. (referred to as "Schedule A" and "Schedule B" Products in the OTN License Agreement for Java SE)
  • (iv) With identified Oracle Cloud Infrastructure products.

Complete release notes for Java 18 can be found here.

The latest version of Java is Java 20 or JDK 20 released on March, 2023. However, many versions of Java are actively maintained for compatibility purposes. Java 8, Java 11 and Java 17 are the three long-term support versions recommended by Oracle. You can download the version you need below:

Contents of the JDK

This section contains a general summary of the files and directories in the JDK.

Executables

  • (In the bin/ subdirectory) An implementation of the Java Runtime Environment (JRE). The JRE includes a Java Virtual Machine (JVM™), class libraries, and other files that support the execution of programs written in the Java programming language. This directory also includes tools and utilities that will help you develop, execute, debug, and document programs written in the Java programming language. For further information, see the JDK 18 tools specification at https://docs.oracle.com/en/java/javase/18/docs/specs/man/index.html

Configuration files

  • (In the conf/ subdirectory) Files that contain user-configurable options. Files in this directory can be edited to change the JDK's access permissions, configure security algorithms, and set the Java Cryptography Extension Policy Files which might be used to limit the JDK's cryptographic strength.

C header Files

  • (In the include/ subdirectory) C-language header files that support native-code programming with the Java Native Interface and the Java Virtual Machine (JVM) Debugger Interface.

Compiled Java Modules

  • (in the jmods/ subdirectory) Compiled modules used by jlink to create custom runtimes.

Copyright and License files

  • (in the legal/ subdirectory) License and copyright files for each module. Includes third party notices as .md (markdown)files.

Additional Libraries

  • (In the lib/ subdirectory) Additional class libraries and support files required by the JDK. These files are not intended for external use.

Compatibility

See the JDK 18 Migration Guide for a list of known compatibility issues. Every effort has been made to support programs written for previous versions of the Java platform. Although some incompatible changes were necessary, most software should migrate to the current version with no changes. Most failures to do so are considered bugs, except for a small number of cases where compatibility was deliberately broken, as described on our compatibility web page. Some compatibility-breaking changes were required to close potential security holes or to fix implementation or design bugs.

Installation

Installation instructions are located on the Java SE documentation site.

What's New

Removed Features and Options

security-libs/javax.security

â Remove the Alternate ThreadLocal Implementation of the Subject::current and Subject::callAs APIs

The "jdk.security.auth.subject.useTL" system property and the alternate ThreadLocal implementation of the Subject::current and Subject::callAs APIs have been removed. The default implementation of these APIs is still supported.

Other Notes

core-libs/java.net â Update java.net.InetAddress to Detect Ambiguous IPv4 Address Literals

The java.net.InetAddress class has been updated to strictly accept IPv4 address literals in decimal quad notation. The InetAddress class methods are updated to throw an java.net.UnknownHostException for invalid IPv4 address literals. To disable this check, the new "jdk.net.allowAmbiguousIPAddressLiterals" system property can be set to "true".

hotspot/runtime â CPU Shares Ignored When Computing Active Processor Count

Previous JDK releases used an incorrect interpretation of the Linux cgroups parameter "cpu.shares". This might cause the JVM to use fewer CPUs than available, leading to an under utilization of CPU resources when the JVM is used inside a container.

Starting from this JDK release, by default, the JVM no longer considers "cpu.shares" when deciding the number of threads to be used by the various thread pools. The -XX:+UseContainerCpuShares command-line option can be used to revert to the previous behavior. This option is deprecated and may be removed in a future JDK release.

tools/javac â Lambda Deserialization Fails for Object Method References on Interfaces

Deserialization of serialized method references to Object methods, which was using an interface as the type on which the method is invoked, can now be deserialized again. Note the classfiles need to be recompiled to allow the deserialization.

Previous release notes

Oracle today announced the availability of Java 18, the latest version of the world's number one programming language and development platform. Java 18 (Oracle JDK 18) delivers thousands of performance, stability, and security improvements, including nine enhancements to the platform that will further improve developer productivity.

The latest Java Development Kit (JDK) provides updates and improvements with nine JDK Enhancement Proposals (JEPs). These include the capability to add Code Snippets in Java API Documentation (JEP 413), which simplifies the addition of sample source code in API documentation, and Simple Web Server (JEP 408) for prototyping and testing. Developers can explore two incubating modules: the Vector API (JEP 417) and the Foreign Function and Memory API (JEP 419), as well as a preview feature: Pattern Matching for Switch (JEP 420).

"The release of Java 18 demonstrates Oracle's continued commitment to provide enterprises and developers faster access to enhancements with the six-month feature release cadence," said Georges Saab, Vice President of Development, Java Platform Group, Oracle. "We continue to make technical investments that improve the performance, stability, and security of the Java SE Platform implementations, as well as the Java Development Kit."

"Java developers want continued innovation with modern programming language features, developer experience enhancements, cloud managed services, and stability," said James Governor, Principal Analyst, RedMonk. "With Java's consistent six-month release cadence Oracle is meeting those demands, helping to keep Java relevant for modern applications and workloads."

Accelerating Java's Adoption in the Cloud

Oracle recently introduced Java Management Service (JMS), a new Oracle Cloud Infrastructure (OCI) native service to help manage Java runtimes and applications on-premises or on any cloud. JMS delivers the information needed to manage Java deployments across the enterprise. Java Management Service is included for OCI workloads and for Java SE Subscribers.

Java 18 is the latest release under Java's six-month release cadence and is the result of extensive collaboration between Oracle engineers and other members of the worldwide Java developer community via the OpenJDK Project and the Java Community Process (JCP). This provides a steady stream of innovations while also delivering continued performance, stability and security improvements that will increase Java's pervasiveness across organizations and industries of all sizes. The largest changes delivered in Java 18 are:

Updates and Improvements to Libraries

  • JEP 400: UTF-8 by Default---Sets UTF-8 as the default charset of the standard Java APIs. With this change, APIs that depend on the default charset will behave consistently across all implementations, operating systems, locales, and configurations.
  • JEP 408: Simple Web Server---A command-line tool and API to start a minimal web server that serves static files only. This tool will be useful for prototyping, ad-hoc coding, and testing purposes, particularly in educational contexts.
  • JEP 416: Reimplement Core Reflection with Method Handles---Reimplements java.lang.reflect.Method, Constructor, and Field on top of java.lang.invoke method handles. By making method handles the underlying mechanism for reflection, it reduces the maintenance and development cost of both the java.lang.reflect and java.lang.invoke APIs.
  • JEP 418: Internet-Address Resolution SPI---Defines a service-provider interface (SPI) for host name and address resolution, so that java.net.InetAddress can make use of resolvers other than the platform's built-in resolver.

Tools

  • JEP 413: JEP Code Snippets in Java API Documentation---Introduces the @snippet tag for JavaDoc's Standard Doclet to simplify the inclusion of example source code in API documentation.

Preview and Incubators for Later JDK Releases

  • JEP 417: Vector API (Third Incubator)---Provides an API for developers to reliably leverage CPU architectures that provide scalable vector extensions. This will lead to superior performance compared to equivalent computations on non-extended processors.
  • JEP 419: Foreign Function and Memory API (Second Incubator)---Enables Java programs to interoperate with code and data outside of the Java runtime. By efficiently invoking foreign functions (i.e., code outside the JVM), and by safely accessing foreign memory (i.e., memory not managed by the JVM), the API enables Java programs to call native libraries and process native data without the brittleness and pitfalls of JNI.
  • JEP 420: Pattern Matching for Switch (Second Preview)---Enhances the Java programming language with pattern matching for switch expressions and statements, along with extensions to the language of patterns. Extending pattern matching to switch allows an expression to be tested against a number of patterns, each with a specific action, so that complex data-oriented queries can be expressed concisely and safely.

Future Proofing Java Programs

  • JEP 421: Deprecate Finalization for Removal---Finalization remains enabled by default for now, but can be disabled to facilitate testing. In a future release, it will be disabled by default, and in a later release, it will be removed. Maintainers of libraries and applications that rely upon finalization should consider migrating to other resource management techniques such as the try-with-resources statement and cleaners.