The Java Version Almanac
javaalmanac.io
Feedback on this page?

New APIs in Java 21

Comparing Java 21 (21-ea+24-2086-open) with Java 19 (19.0.2+7-tem).

Element Modification
java.base
    java.io
      BufferedInputStream
        • - final
        • + sealed
        PushbackInputStream
          SequenceInputStream
            java.lang.constant
              ConstantDescs
                ClassDesc
                  MethodHandleDesc
                    MethodTypeDesc
                      • added
                      • added
                      java.lang.foreign
                        ValueLayout.OfAddress
                        • removed
                        Addressable
                        • + abstract
                        • + abstract
                        • + abstract
                        asVariadic(MemoryLayout...)
                        • + abstract
                        • + abstract
                        equals(Object)
                        firstVariadicArgumentIndex()
                        hashCode()
                        • + abstract
                        • + abstract
                        toString()
                        • - extends AbstractLayout
                        • - final
                        • + abstract
                        • + extends Object
                        • + sealed
                        equals(Object)
                        hashCode()
                        isStruct()
                        isUnion()
                        • + abstract
                        toString()
                        withBitAlignment(long)
                        • removed
                        • added
                        • + abstract
                        Linker
                          downcallHandle(Addressable, FunctionDescriptor)
                          downcallHandle(FunctionDescriptor)
                          downcallType(FunctionDescriptor)
                          upcallStub(MethodHandle, FunctionDescriptor,...
                          upcallType(FunctionDescriptor)
                          MemoryAddress
                          MemoryLayout.PathElement
                            MemoryLayout
                              bitAlignment()
                              • removed
                              bitOffset(MemoryLayout.PathElement...)
                              • removed
                              bitOffsetHandle(MemoryLayout.PathElement...)
                              • removed
                              bitSize()
                              • removed
                              • + abstract
                              isPadding()
                              paddingLayout(long)
                              structLayout(MemoryLayout...)
                              unionLayout(MemoryLayout...)
                              valueLayout(Class, ByteOrder)
                              withBitAlignment(long)
                              • removed
                              • added
                              • - implements Addressable
                              address()
                              allocateNative(MemoryLayout, MemorySession)
                              allocateNative(long, MemorySession)
                              allocateNative(long, long, MemorySession)
                              • + abstract
                              get(ValueLayout.OfAddress, long)
                              getAtIndex(ValueLayout.OfAddress, long)
                              • - abstract
                              ofAddress(MemoryAddress, long, MemorySession)
                              session()
                              set(ValueLayout.OfAddress, long, Addressable)
                              setAtIndex(ValueLayout.OfAddress, long,...
                              MemorySession
                              SegmentAllocator
                                allocate(ValueLayout.OfAddress, Addressable)
                                implicitAllocator()
                                newNativeArena(MemorySession)
                                newNativeArena(long, MemorySession)
                                newNativeArena(long, long, MemorySession)
                                • - extends AbstractLayout
                                • - final
                                • + abstract
                                • + extends Object
                                • + sealed
                                • + abstract
                                • + abstract
                                equals(Object)
                                • + abstract
                                hashCode()
                                • + abstract
                                toString()
                                withBitAlignment(long)
                                • removed
                                • added
                                • + abstract
                                • + abstract
                                SymbolLookup
                                  libraryLookup(Path, MemorySession)
                                  libraryLookup(String, MemorySession)
                                  lookup(String)
                                  • added
                                  VaList.Builder
                                  VaList
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  • - extends AbstractLayout
                                  • + abstract
                                  • + extends Object
                                  • + abstract
                                  • + abstract
                                  equals(Object)
                                  hashCode()
                                  • + abstract
                                  toString()
                                  withBitAlignment(long)
                                  • removed
                                  • added
                                  • + abstract
                                  • + abstract
                                  java.lang.invoke
                                    ClassSpecializer.Factory
                                    • removed
                                    ClassSpecializer.SpeciesData
                                    • removed
                                    StringConcatFactory
                                      java.lang.module
                                        ModuleDescriptor.Exports
                                          ModuleDescriptor.Opens
                                            ModuleDescriptor.Requires
                                              ModuleDescriptor
                                                java.lang.reflect
                                                  Executable
                                                    • + abstract
                                                    Field
                                                      Parameter
                                                        Member
                                                          java.lang.runtime
                                                            • added
                                                            • added
                                                            • added
                                                            • - preview
                                                            java.lang
                                                              Character.UnicodeBlock
                                                                Character
                                                                  Class
                                                                    Compiler
                                                                    FdLibm.Cbrt
                                                                    • removed
                                                                    FdLibm.Hypot
                                                                    • removed
                                                                    FdLibm.Pow
                                                                    • removed
                                                                    Float
                                                                      • - preview
                                                                      Math
                                                                        ModuleLayer.Controller
                                                                          Module
                                                                            StrictMath
                                                                              • + implements Appendable
                                                                              • + implements Appendable
                                                                              String
                                                                                • + deprecated
                                                                                • + forRemoval
                                                                                ThreadGroup
                                                                                  allowThreadSuspension(boolean)
                                                                                  Thread
                                                                                    • - preview
                                                                                    • - preview
                                                                                    • - preview
                                                                                    • - preview
                                                                                    Character.UnicodeScript
                                                                                      • - preview
                                                                                      allowSetThreadLocals(boolean)
                                                                                      • - preview
                                                                                      allowSetThreadLocals(boolean)
                                                                                      • - preview
                                                                                      allowSetThreadLocals(boolean)
                                                                                      java.net
                                                                                        URL
                                                                                          • + deprecated
                                                                                          • + deprecated
                                                                                          • + deprecated
                                                                                          • + deprecated
                                                                                          • + deprecated
                                                                                          • + deprecated
                                                                                          java.nio.channels
                                                                                            FileChannel
                                                                                              map(FileChannel.MapMode, long, long,...
                                                                                              java.nio.file.spi
                                                                                                FileSystemProvider
                                                                                                  java.security.interfaces
                                                                                                    DSAKeyPairGenerator
                                                                                                      • - throws InvalidParameterException
                                                                                                      • - throws InvalidParameterException
                                                                                                      java.security
                                                                                                        InvalidParameterException
                                                                                                          java.util.concurrent
                                                                                                            ConcurrentSkipListMap
                                                                                                              ConcurrentSkipListSet
                                                                                                                CopyOnWriteArrayList
                                                                                                                  DelayQueue
                                                                                                                    Executors
                                                                                                                      • - preview
                                                                                                                      • - preview
                                                                                                                      ForkJoinPool
                                                                                                                        ForkJoinWorkerThread
                                                                                                                          java.util.regex
                                                                                                                            Matcher
                                                                                                                              Pattern
                                                                                                                                MatchResult
                                                                                                                                  java.util.zip
                                                                                                                                    ZipInputStream
                                                                                                                                      java.util
                                                                                                                                        ArrayList
                                                                                                                                          • + final
                                                                                                                                          Collections
                                                                                                                                            • added
                                                                                                                                            • added
                                                                                                                                            • added
                                                                                                                                            • added
                                                                                                                                            IdentityHashMap
                                                                                                                                              • - implements Map
                                                                                                                                              • + implements SequencedMap
                                                                                                                                              • - implements Set
                                                                                                                                              • + implements SequencedSet
                                                                                                                                              LinkedList
                                                                                                                                                Locale
                                                                                                                                                  TreeMap
                                                                                                                                                    TreeSet
                                                                                                                                                      • + implements SequencedCollection
                                                                                                                                                      • - implements Collection
                                                                                                                                                      • + implements SequencedCollection
                                                                                                                                                      NavigableMap
                                                                                                                                                        NavigableSet
                                                                                                                                                          • - implements Map
                                                                                                                                                          • + implements SequencedMap
                                                                                                                                                          • + implements SequencedSet
                                                                                                                                                          javax.net.ssl
                                                                                                                                                            KeyManagerFactory
                                                                                                                                                              • + final
                                                                                                                                                              SSLParameters
                                                                                                                                                                TrustManagerFactory
                                                                                                                                                                  • + final
                                                                                                                                                                  java.compiler
                                                                                                                                                                    javax.lang.model.element
                                                                                                                                                                      VariableElement
                                                                                                                                                                        • added preview
                                                                                                                                                                        javax.lang.model.util
                                                                                                                                                                          Elements
                                                                                                                                                                            javax.lang.model
                                                                                                                                                                              SourceVersion
                                                                                                                                                                                java.desktop
                                                                                                                                                                                  javax.swing.plaf.synth
                                                                                                                                                                                    SynthComboBoxUI
                                                                                                                                                                                      SynthLookAndFeel
                                                                                                                                                                                        • + deprecated
                                                                                                                                                                                        • + forRemoval
                                                                                                                                                                                        SynthPasswordFieldUI
                                                                                                                                                                                          javax.swing.text.html
                                                                                                                                                                                            AccessibleHTML.HTMLAccessibleContext
                                                                                                                                                                                              javax.swing.text
                                                                                                                                                                                                DefaultEditorKit
                                                                                                                                                                                                  java.management.rmi
                                                                                                                                                                                                    javax.management.remote.rmi
                                                                                                                                                                                                      RMIIIOPServerImpl
                                                                                                                                                                                                      java.management
                                                                                                                                                                                                        javax.management.loading
                                                                                                                                                                                                          • + deprecated
                                                                                                                                                                                                          • + forRemoval
                                                                                                                                                                                                          • + deprecated
                                                                                                                                                                                                          • + forRemoval
                                                                                                                                                                                                          • + deprecated
                                                                                                                                                                                                          • + forRemoval
                                                                                                                                                                                                          • + deprecated
                                                                                                                                                                                                          • + forRemoval
                                                                                                                                                                                                          javax.management.remote
                                                                                                                                                                                                            JMXConnector
                                                                                                                                                                                                              • + deprecated
                                                                                                                                                                                                              • + forRemoval
                                                                                                                                                                                                              java.net.http
                                                                                                                                                                                                                java.net.http
                                                                                                                                                                                                                  • + implements AutoCloseable
                                                                                                                                                                                                                  java.xml.crypto
                                                                                                                                                                                                                    javax.xml.crypto.dsig
                                                                                                                                                                                                                      SignatureMethod
                                                                                                                                                                                                                        • added
                                                                                                                                                                                                                        • added

                                                                                                                                                                                                                        This report is based on simple comparison of all public and protected APIs of the java.* and javax.* packages of JDK builds 21-ea+24-2086-open and 19.0.2+7-tem. It does not make statements about compatibility.

                                                                                                                                                                                                                        For the latest Java versions the corresponding CSRs (Compatibility & Specification Review) are linked for a quick reference to find out about the reasoning of the change.

                                                                                                                                                                                                                        More detailed API comparisons based on the japicmp tool can be found here.