Java is a programming language and software platform. Examples of applications that use Java are numerous and widespread but include web browsers, office applications, and even games like Minecraft are based on Java.

The full version string for this update release is 21.0.4+8 (where "+" means "build"). The version number is 21.0.4. Complete release notes for Java 21.0.4 can be found here.

If you need to run Java applications, downloading and installing the JRE (Java Runtime Environment) is enough. If you're developing Java applications, you'll want to download the JDK, which also includes the JRE.

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.

The latest version of Java is Java 23 or JDK 23 released on March, 2024. 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:

Java 8 is the last free software public update for commercial use, which explains why it remains popular. Oracle plans to maintain it until at least 2030. Also, you should know that some applications might refer to Java 8 as version 1.8.0.

What is Java JDK?

The Java Development Kit (JDK) is the full-featured software development kit for Java developers. It has everything the JRE has, but adds the compiler (javac) and tools (like javadoc and jdb). The JDK allows you to create and compile Java programs.

Is Java free to use?

Yes, Java is free to use under the jdk.java.net license. This means anyone can download it for personal or development use at no cost. Oracle does charge for long term support, but this is optional.

Security Baselines

The security baselines for the Java Runtime Environment (JRE) at the time of the release of JDK 11.0.22 are specified in the following table:

JRE Family Version = JRE Security Baseline (Full Version String)

  • 21 = 21.0.4+8
  • 8 = 8u371-b11

Keeping the JDK up to Date

Oracle recommends that the JDK is updated with each Critical Patch Update. In order to determine if a release is the latest, the Security Baseline page can be used to determine which is the latest version for each release family.

Critical patch updates, which contain security vulnerability fixes, are announced one year in advance on Critical Patch Updates, Security Alerts and Bulletins. It is not recommended that this JDK (version 21.0.4) be used after the next critical patch update scheduled for October 15, 2024.

Java Management Service, available to all users, can help you find vulnerable Java versions in your systems. Java SE Subscribers and customers running in Oracle Cloud can use Java Management Service to update Java Runtimes and to do further security reviews like identifying potentially vulnerable third party libraries used by your Java programs. Existing Java Management Service user click here to log in to your dashboard. The Java Management Service Documentation provides a list of features available to everyone and those available only to customers. Learn more about using Java Management Service to monitor and secure your Java Installations.

What's New

security-libs/java.security

  • ➜ New Security Category for -XshowSettings Launcher Option (JDK-8281658) bcategory: java.time Description: (tz) Update Timezone Data to 2022a

hotspot/gc

  • ➜ G1: Balance Code Root Scan Phase During Garbage Collection (JDK-8315503)
  • The Code Root Scan Phase during garbage collection finds references to Java objects in compiled code. To speed up this process, G1 maintains a remembered set for compiled code that contains references into the Java heap. That is, every region contains a set of compiled code that contains references into it.
  • Assuming that such references are few, previous code used a single thread per region to iterate over a particular region's references, which poses a scalability bottleneck if the distribution of these references is very unbalanced.
  • G1 now distributes this code root scan work across multiple threads within regions, removing this bottleneck.

hotspot/gc

  • ➜ Parallel: Precise Parallel Scanning of Large Object Arrays for Young Collection Roots (JDK-8310031)
  • During a young collection, ParallelGC partitions the old generation into 64kB stripes when scanning it for references into the young generation. These stripes are assigned to worker threads that do the scanning in parallel as work units.
  • Before this change, Parallel GC always scanned these stripes completely even if only a small part had been known to contain interesting references. Additionally, every worker thread processed the objects that start in that stripe by itself, including parts of objects that extend into other stripes. This behavior limited parallelism when processing large objects. A single large object, potentially containing thousands of references, had been scanned by a single thread only and in full. This would cause bad scaling due to memory sharing and cache misses in the subsequent long, work stealing phase.
  • With this change, Parallel GC workers limit work to their stripe and only process interesting parts of large object arrays. This reduces the work done by a single thread for a stripe, improves parallelism, and reduces the amount of work stealing. Parallel GC pauses are now on par with G1 in presence of large object arrays, reducing pause times by 4-5 times in some cases.

Bug Fixes
This release also contains fixes for security vulnerabilities described in the Oracle Critical Patch Update.

  • JDK-8318854 - client-libs/java.awt - [macos14] Running any AWT app prints Secure coding warning
  • JDK-8317771 - client-libs/javax.accessibility - [macos14] Expand/collapse a JTree using keyboard freezes the application in macOS 14 Sonoma
  • JDK-8322239 - client-libs/javax.swing - [macos] a11y : java.lang.NullPointerException is thrown when focus is moved on the JTabbedPane
  • JDK-8187759 - client-libs/javax.swing - Background not refreshed when painting over a transparent JFrame
  • JDK-8320692 - client-libs/javax.swing - Null icon returned for .exe without custom icon
  • JDK-8324858 - core-libs - [vectorapi] Bounds checking issues when accessing memory segments
  • JDK-8315373 - core-libs/java.lang - Change VirtualThread to unmount after freezing, re-mount before thawing
  • JDK-8322846 - core-libs/java.lang - Running with -Djdk.tracePinnedThreads set can hang
  • JDK-8322818 - core-libs/java.lang - Thread::getStackTrace can fail with InternalError if virtual thread is timed-parked when pinned
  • JDK-8321270 - core-libs/java.lang - Virtual Thread.yield consumes parking permit
  • JDK-8312498 - core-libs/java.lang - Thread::getState and JVM TI GetThreadState should return TIMED_WAITING virtual thread is timed parked
  • JDK-8320570 - core-libs/java.lang - NegativeArraySizeException decoding >1G UTF8 bytes with non-ascii characters
  • JDK-8306040 - core-libs/java.net - HttpResponseInputStream.available() returns 1 on empty stream
  • JDK-8318599 - core-libs/java.net - HttpURLConnection cache issues leading to crashes in JGSS w/ native GSS introduced by 8303809
  • JDK-8318322 - core-libs/java.util:i18n - Update IANA Language Subtag Registry to Version 2023-10-16
  • JDK-8327631 - core-libs/java.util:i18n - Update IANA Language Subtag Registry to Version 2024-03-07
  • JDK-8313702 - core-libs/java.util:i18n - Update IANA Language Subtag Registry to Version 2023-08-02
  • JDK-8325672 - hotspot/compiler - C2: allocate PhaseIdealLoop::_loop_or_ctrl from C->comp_arena()
  • JDK-8323065 - hotspot/compiler - Unneccesary CodeBlob lookup in CompiledIC::internal_set_ic_destination
  • JDK-8320206 - hotspot/compiler - Some intrinsics/stubs missing vzeroupper on x86_64
  • JDK-8316670 - hotspot/compiler - Remove effectively unused nmethodBucket::_count
  • JDK-8317235 - hotspot/compiler - Remove Access API use in nmethod class
  • JDK-8316669 - hotspot/compiler - ImmutableOopMapSet destructor not called
  • JDK-8317677 - hotspot/compiler - Specialize Vtablestubs::entry_for() for VtableBlob
  • JDK-8293069 - hotspot/compiler - Make -XX:+Verbose less verbose
  • JDK-8316959 - hotspot/compiler - Improve InlineCacheBuffer pending queue management
  • JDK-8314220 - hotspot/compiler - Configurable InlineCacheBuffer size
  • JDK-8324050 - hotspot/compiler - Issue store-store barrier after re-materializing objects during deoptimization
  • JDK-8326638 - hotspot/compiler - Crash in PhaseIdealLoop::remix_address_expressions due to unexpected Region instead of Loop
  • JDK-8328165 - hotspot/compiler - improve assert(idx < _maxlrg) failed: oob
  • JDK-8325432 - hotspot/compiler - enhance assert message "relocation addr must be in this section"
  • JDK-8313899 - hotspot/compiler - JVMCI exception Translation can fail in TranslatedException.
  • JDK-8328702 - hotspot/compiler - C2: Crash during parsing because sub type check is not folded
  • JDK-8317809 - hotspot/compiler - Insertion of free code blobs into code cache can be very slow during class unloading
  • JDK-8324817 - hotspot/gc - Parallel GC does not pre-touch all heap pages when AlwaysPreTouch enabled and large page disabled
  • JDK-8315605 - hotspot/gc - G1: Add number of nmethods in code roots scanning statistics
  • JDK-8317350 - hotspot/gc - Move code cache purging out of CodeCache::UnloadingScope
  • JDK-8318585 - hotspot/gc - Rename CodeCache::UnloadingScope to UnlinkingScope
  • JDK-8318720 - hotspot/gc - G1: Memory leak in G1CodeRootSet after JDK-8315503
  • JDK-8317007 - hotspot/gc - Add bulk removal of dead nmethods during class unloading
  • JDK-8288936 - hotspot/jfr - Wrong lock ordering writing G1HeapRegionTypeChange JFR event
  • JDK-8326106 - hotspot/jfr - Write and clear stack trace table outside of safepoint
  • JDK-8312777 - hotspot/jvmti - notifyJvmtiMount before notifyJvmtiUnmount
  • JDK-8322282 - hotspot/runtime - Incorrect LoaderConstraintTable::add_entry after JDK-8298468
  • JDK-8316132 - hotspot/runtime - CDSProtectionDomain::get_shared_protection_domain should check for exception
  • JDK-8319137 - hotspot/runtime - release _object in ObjectMonitor dtor to avoid races
  • JDK-8324514 - hotspot/runtime - ClassLoaderData::print_on should print address of class loader
  • JDK-8320275 - hotspot/runtime - assert(_chunk->bitmap().at(index)) failed: Bit not set at index
  • JDK-8323595 - hotspot/runtime - is_aligned(p, alignof(OopT))) assertion fails in Jetty without compressed OOPs
  • JDK-8320515 - hotspot/runtime - assert(monitor->object_peek() != nullptr) failed: Owned monitors should not have a dead object
  • JDK-8319896 - hotspot/runtime - Remove monitor deflation from final audit
  • JDK-8325437 - hotspot/runtime - Safepoint polling in monitor deflation can cause massive logs
  • JDK-8316002 - hotspot/runtime - Remove unnecessary seen_dead_loader in ClassLoaderDataGraph::do_unloading
  • JDK-8315998 - hotspot/runtime - Remove dead ClassLoaderDataGraphKlassIteratorStatic
  • JDK-8319955 - hotspot/runtime - Improve dependencies removal during class unloading
  • JDK-8324824 - hotspot/runtime - AArch64: Detect Ampere-1B core and update default options for Ampere CPUs
  • JDK-8327036 - hotspot/runtime - [macosx-aarch64] SIGBUS in MarkActivationClosure::do_code_blob reached from Unsafe_CopySwapMemory0
  • JDK-8322783 - hotspot/runtime - prioritize /etc/os-release over /etc/SuSE-release in hs_err/info output
  • JDK-8319048 - hotspot/runtime - Monitor deflation unlink phase prolongs time to safepoint
  • JDK-8315559 - hotspot/runtime - Delay TempSymbol cleanup to avoid symbol table churn
  • JDK-8324933 - hotspot/runtime - ConcurrentHashTable::statistics_calculate synchronization is expensive
  • JDK-8326643 - security-libs/java.security - JDK server does not send a dummy change_cipher_spec record after HelloRetryRequest message
  • JDK-8312383 - security-libs/javax.net.ssl - Log X509ExtendedKeyManager implementation class name in TLS/SSL connection
  • JDK-8294699 - tools/jpackage - Launcher causes lingering busy cursor
  • JDK-8325203 - tools/jpackage - System.exit(0) kills the launched 3rd party application