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

New APIs in Java 21

Comparing Java 21 (21.0.2+13-LTS-tem) 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
                      • + abstract
                      java.lang.foreign
                        ValueLayout.OfAddress
                        • removed preview
                        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)
                        • + abstract
                        Linker
                          downcallHandle(Addressable, FunctionDescriptor)
                          downcallHandle(FunctionDescriptor)
                          downcallType(FunctionDescriptor)
                          upcallStub(MethodHandle, FunctionDescriptor,...
                          upcallType(FunctionDescriptor)
                          MemoryAddress
                          MemoryLayout.PathElement
                            MemoryLayout
                              bitAlignment()
                              bitOffset(MemoryLayout.PathElement...)
                              bitOffsetHandle(MemoryLayout.PathElement...)
                              bitSize()
                              • + abstract
                              isPadding()
                              paddingLayout(long)
                              structLayout(MemoryLayout...)
                              unionLayout(MemoryLayout...)
                              valueLayout(Class, ByteOrder)
                              withBitAlignment(long)
                              • - 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)
                                • + abstract
                                • + abstract
                                SymbolLookup
                                  libraryLookup(Path, MemorySession)
                                  libraryLookup(String, MemorySession)
                                  lookup(String)
                                  VaList.Builder
                                  VaList
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends ValueLayout
                                  • - final
                                  • + abstract
                                  • + extends Object
                                  • + implements ValueLayout
                                  • + sealed
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  • - extends AbstractLayout
                                  • + abstract
                                  • + extends Object
                                  • + abstract
                                  • + abstract
                                  equals(Object)
                                  hashCode()
                                  • + abstract
                                  toString()
                                  withBitAlignment(long)
                                  • + abstract
                                  • + abstract
                                  java.lang.invoke
                                    ClassSpecializer.Factory
                                    ClassSpecializer.SpeciesData
                                    StringConcatFactory
                                      VarHandle
                                        • - final
                                        java.lang.module
                                          ModuleDescriptor.Exports
                                            ModuleDescriptor.Opens
                                              ModuleDescriptor.Requires
                                                ModuleDescriptor
                                                  java.lang.reflect
                                                    Executable
                                                      • + abstract
                                                      Field
                                                        Parameter
                                                          Member
                                                            java.lang.runtime
                                                              • - preview
                                                              java.lang
                                                                Character.UnicodeBlock
                                                                  Character
                                                                    Class
                                                                      Compiler
                                                                      FdLibm.Cbrt
                                                                      FdLibm.Hypot
                                                                      FdLibm.Pow
                                                                      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
                                                                                                                                              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.crypto
                                                                                                                                                              javax.net.ssl
                                                                                                                                                                KeyManagerFactory
                                                                                                                                                                  • + final
                                                                                                                                                                  SSLParameters
                                                                                                                                                                    TrustManagerFactory
                                                                                                                                                                      • + final
                                                                                                                                                                      java.compiler
                                                                                                                                                                        javax.lang.model.element
                                                                                                                                                                          TypeElement
                                                                                                                                                                            VariableElement
                                                                                                                                                                              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

                                                                                                                                                                                                                              This report is based on simple comparison of all public and protected APIs of the java.* and javax.* packages of JDK builds 21.0.2+13-LTS-tem 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.