# Deprecated API

Show API deprecated in: 12 13 14 15 16 17 18 19 20 21 23 24 25 other Toggle all

## Contents

- Terminally Deprecated
- Modules
- Interfaces
- Classes
- Exception Classes
- Fields
- Methods
- Constructors
- Enum Constants

Terminally Deprecated Elements
Element
Deprecated in
Description
com.sun.jdi.Bootstrap()
16
com.sun.jdi.JDIPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
com.sun.security.jgss.InquireSecContextPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
com.sun.tools.attach.AttachPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
com.sun.tools.javac.Main()
16
java.applet.Applet
9
The Applet API is deprecated, no replacement.
java.applet.AppletContext
9
The Applet API is deprecated, no replacement.
java.applet.AppletStub
9
The Applet API is deprecated, no replacement.
java.applet.AudioClip
9
The Applet API is deprecated, no replacement.
java.awt.AWTPermission
24
There is no replacement for this class.
java.awt.Graphics.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.awt.PrintJob.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.awt.Window.getWarningString()
24
since JDK 24
java.beans.AppletInitializer
9
The Applet API is deprecated. See the java.applet package documentation for further information.
java.beans.beancontext.BeanContext
23
java.beans.beancontext.BeanContextChild
23
java.beans.beancontext.BeanContextChildComponentProxy
23
java.beans.beancontext.BeanContextChildSupport
23
java.beans.beancontext.BeanContextContainerProxy
23
java.beans.beancontext.BeanContextEvent
23
java.beans.beancontext.BeanContextMembershipEvent
23
java.beans.beancontext.BeanContextMembershipListener
23
java.beans.beancontext.BeanContextProxy
23
java.beans.beancontext.BeanContextServiceAvailableEvent
23
java.beans.beancontext.BeanContextServiceProvider
23
java.beans.beancontext.BeanContextServiceProviderBeanInfo
23
java.beans.beancontext.BeanContextServiceRevokedEvent
23
java.beans.beancontext.BeanContextServiceRevokedListener
23
java.beans.beancontext.BeanContextServices
23
java.beans.beancontext.BeanContextServicesListener
23
java.beans.beancontext.BeanContextServicesSupport
23
java.beans.beancontext.BeanContextSupport
23
java.beans.Beans.instantiate(ClassLoader, String, BeanContext)
23
this method will be removed when java.beans.beancontext is removed
java.beans.Beans.instantiate(ClassLoader, String, BeanContext, AppletInitializer)
9
It is recommended to use `Beans.instantiate(ClassLoader, String, BeanContext)`, because the Applet API is deprecated. See the java.applet package documentation for further information.
java.io.FilePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.io.ObjectOutputStream.PutField.write(ObjectOutput)
1.4
This method does not write the values contained by this `PutField` object in a proper format, and may result in corruption of the serialization stream. The correct way to write `PutField` data is by calling the `ObjectOutputStream.writeFields()` method.
java.io.SerializablePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.lang.Enum.finalize()
18
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.lang.management.ManagementPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
java.lang.Object.finalize()
9
Finalization is deprecated and subject to removal in a future release. The use of finalization can lead to problems with security, performance, and reliability. See JEP 421 for discussion and alternatives.

Subclasses that override `finalize` to perform cleanup should use alternative cleanup mechanisms and remove the `finalize` method. Use `Cleaner` and `PhantomReference` as safer ways to release resources when an object becomes unreachable. Alternatively, add a `close` method to explicitly release resources, and implement `AutoCloseable` to enable use of the `try`-with-resources statement.

This method will remain in place until finalizers have been removed from most existing code.

java.lang.reflect.ReflectPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.lang.Runtime.runFinalization()
18
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.

When running in a JVM in which finalization has been disabled or removed, no objects will be pending finalization, so this method does nothing.

java.lang.RuntimePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.lang.SecurityManager
17
There is no replacement for this class.
java.lang.System.getSecurityManager()
17
This method originally returned the system-wide Security Manager. Setting a Security Manager is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.System.runFinalization()
18
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.

When running in a JVM in which finalization has been disabled or removed, no objects will be pending finalization, so this method does nothing.

java.lang.System.setSecurityManager(SecurityManager)
17
This method originally set the system-wide Security Manager. Setting a Security Manager is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.Thread.checkAccess()
17
This method originally determined if the currently running thread had permission to modify this thread. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.Thread.stop()
1.2
This method was originally specified to "stop" a victim thread by causing the victim thread to throw a `ThreadDeath`. It was inherently unsafe. Stopping a thread caused it to unlock all of the monitors that it had locked (as a natural consequence of the `ThreadDeath` exception propagating up the stack). If any of the objects previously protected by these monitors were in an inconsistent state, the damaged objects became visible to other threads, potentially resulting in arbitrary behavior. Usages of `stop` should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. The target thread should check this variable regularly, and return from its run method in an orderly fashion if the variable indicates that it is to stop running. If the target thread waits for long periods (on a condition variable, for example), the `interrupt` method should be used to interrupt the wait. For more information, see Why is Thread.stop deprecated and the ability to stop a thread removed?.
java.lang.ThreadDeath
20
`Thread.stop()` was originally specified to "stop" a victim thread by causing the victim thread to throw a `ThreadDeath`. It was inherently unsafe and deprecated in an early JDK release. The ability to "stop" a thread with `Thread.stop` has been removed and the `Thread.stop` method changed to throw an exception. Consequently, `ThreadDeath` is also deprecated, for removal.
java.lang.ThreadGroup.checkAccess()
17
This method originally determined if the currently running thread had permission to modify this thread group. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.ThreadGroup.destroy()
16
This method was originally specified to destroy an empty thread group. The ability to explicitly destroy a thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.lang.ThreadGroup.isDaemon()
16
This method originally indicated if the thread group is a daemon thread group that is automatically destroyed when its last thread terminates. The concept of daemon thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.lang.ThreadGroup.isDestroyed()
16
This method originally indicated if the thread group is destroyed. The ability to destroy a thread group and the concept of a destroyed thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.lang.ThreadGroup.setDaemon(boolean)
16
This method originally configured whether the thread group is a daemon thread group that is automatically destroyed when its last thread terminates. The concept of daemon thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.net.DatagramSocketImpl.getTTL()
1.2
use getTimeToLive instead.
java.net.DatagramSocketImpl.setTTL(byte)
1.2
use setTimeToLive instead.
java.net.HttpURLConnection.getPermission()
25
Permissions can no longer be used for controlling access to resources as the Security Manager is no longer supported.
java.net.MulticastSocket.getTTL()
1.2
use the `MulticastSocket.getTimeToLive()` method instead, which returns an int instead of a byte.
java.net.MulticastSocket.send(DatagramPacket, byte)
1.4
Use the following code or its equivalent instead:

      ......
     int ttl = mcastSocket.getOption(StandardSocketOptions.IP_MULTICAST_TTL);
     mcastSocket.setOption(StandardSocketOptions.IP_MULTICAST_TTL, newttl);
     mcastSocket.send(p);
     mcastSocket.setOption(StandardSocketOptions.IP_MULTICAST_TTL, ttl);
     ......

java.net.MulticastSocket.setTTL(byte)
1.2
use the `MulticastSocket.setTimeToLive(int)` method instead, which uses int instead of byte as the type for ttl.
java.net.NetPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.net.Socket(String, int, boolean)
1.1
The `stream` parameter provided a way in early JDK releases to create a `Socket` that used a datagram socket. This feature no longer exists. Instead use `DatagramSocket` for datagram sockets.
java.net.Socket(InetAddress, int, boolean)
1.1
The `stream` parameter provided a way in early JDK releases to create a `Socket` that used a datagram socket. This feature no longer exists. Instead use `DatagramSocket` for datagram sockets.
java.net.URLConnection.getPermission()
25
Permissions can no longer be used for controlling access to resources as the Security Manager is no longer supported.
java.net.URLPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.nio.file.LinkPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.rmi.RMISecurityManager
1.8
There is no replacement for the Security Manager.
java.security.AccessControlContext
17
This class was only useful in conjunction with the the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.AccessControlException
17
This exception was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.AccessController
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.Certificate
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.cert.Certificate` and related classes.
java.security.DomainCombiner
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.Identity
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.KeyStore`, the `java.security.cert` package, and `java.security.Principal`.
java.security.IdentityScope
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.KeyStore`, the `java.security.cert` package, and `java.security.Principal`.
java.security.Policy
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. Installing a system-wide `Policy` object is no longer supported. The setPolicy method has been changed to always throw `UnsupportedOperationException`. The getPolicy method has been changed to always return a `Policy` object that grants no permissions. There is no replacement for the Security Manager or this class.
java.security.Policy.Parameters
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.PolicySpi
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.SecurityPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.security.Signer
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.KeyStore`, the `java.security.cert` package, and `java.security.Principal`.
java.security.UnresolvedPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.util.concurrent.Executors.privilegedCallable(Callable<T>)
17
This method originally returned a `Callable` object that when called, executed the given `callable` under the current access control context. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.concurrent.Executors.privilegedCallableUsingCurrentClassLoader(Callable<T>)
17
This method originally returned a `Callable` object that when called, executed the given `callable` under the current access control context, with the current context class loader as the context class loader. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.concurrent.Executors.privilegedThreadFactory()
17
This method originally returned a thread factory that created new threads that had the same access control context as the current thread. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.concurrent.ThreadPoolExecutor.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.util.logging.LoggingPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.util.logging.LogManager.checkAccess()
17
This method originally checked that the current context was trusted to modify the logging configuration. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.PropertyPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.util.zip.ZipError
24
ZipError is no longer used and is obsolete. `ZipException` should be used instead.
javax.imageio.spi.ServiceRegistry.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.FileCacheImageInputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.FileImageInputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.FileImageOutputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.ImageInputStreamImpl.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.MemoryCacheImageInputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.management.MBeanPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.management.MBeanServerPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.management.MBeanTrustPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.management.modelmbean.DescriptorSupport(String)
25
This constructor exists for historical reasons. If reading from XML is required, it should be implemented externally.
javax.management.modelmbean.DescriptorSupport.toXMLString()
25
This method exists for historical reasons. If writing to XML is required, it should be implemented externally.
javax.management.modelmbean.XMLParseException
25
This class exists only to support XML parsing implemented privately in this module, in DescriptorSupport. That feature is deprecated for removal.
javax.management.relation.RoleStatus()
16
javax.management.remote.JMXConnector.getMBeanServerConnection(Subject)
21
This method supported the legacy Subject Delegation feature, which has been removed. There is no replacement.
javax.management.remote.SubjectDelegationPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain()
9
The `HandshakeCompletedEvent.getPeerCertificates()` method that returns an array of `java.security.cert.Certificate` should be used instead.
javax.net.ssl.SSLPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.net.ssl.SSLSession.getPeerCertificateChain()
9
The `SSLSession.getPeerCertificates()` method that returns an array of `java.security.cert.Certificate` should be used instead.
javax.security.auth.AuthPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.kerberos.DelegationPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.kerberos.ServicePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.PrivateCredentialPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.Subject.doAs(Subject, PrivilegedAction<T>)
18
This method originally performed the specified `PrivilegedAction` with privileges enabled. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.doAs(Subject, PrivilegedExceptionAction<T>)
18
This method originally performed the specified `PrivilegedExceptionAction` with privileges enabled. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.doAsPrivileged(Subject, PrivilegedAction<T>, AccessControlContext)
17
This method originally performed the specified `PrivilegedAction` with privileges enabled and restricted by the specified `AccessControlContext`. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to ignore the `AccessControlContext` and launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.doAsPrivileged(Subject, PrivilegedExceptionAction<T>, AccessControlContext)
17
This method originally performed the specified `PrivilegedExceptionAction` with privileges enabled and restricted by the specified `AccessControlContext`. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to ignore the `AccessControlContext` and launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.getSubject(AccessControlContext)
17
This method used to get the subject associated with the provided `AccessControlContext`, which was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to always throw `UnsupportedOperationException`. A replacement API named `Subject.current()` has been added which can be used to obtain the current subject. There is no replacement for the Security Manager.
javax.security.auth.SubjectDomainCombiner
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
javax.security.cert.Certificate
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateEncodingException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateExpiredException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateNotYetValidException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateParsingException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.X509Certificate
9
Use the classes in `java.security.cert` instead.
javax.sound.sampled.AudioPermission
24
There is no replacement for this class.
javax.swing.JApplet
9
The Applet API is deprecated, no replacement.
javax.swing.JInternalFrame.getWarningString()
24
since JDK 24
javax.swing.plaf.basic.BasicDirectoryModel.intervalAdded(ListDataEvent)
17
Obsolete method, not used anymore.
javax.swing.plaf.basic.BasicDirectoryModel.intervalRemoved(ListDataEvent)
17
Obsolete method, not used anymore.
javax.swing.plaf.basic.BasicDirectoryModel.lt(File, File)
17
Obsolete method, not used anymore.
javax.swing.plaf.basic.BasicMenuItemUI.MouseInputHandler
17
javax.swing.plaf.basic.BasicScrollPaneUI.HSBChangeListener
17
javax.swing.plaf.basic.BasicScrollPaneUI.PropertyChangeHandler
17
javax.swing.plaf.basic.BasicScrollPaneUI.ViewportChangeHandler
17
javax.swing.plaf.basic.BasicScrollPaneUI.VSBChangeListener
17
javax.swing.plaf.basic.BasicToolBarUI.createFloatingFrame(JToolBar)
17
It is recommended that `BasicToolBarUI.createFloatingWindow(JToolBar)` be used instead
javax.swing.RepaintManager.addDirtyRegion(Applet, int, int, int, int)
9
The Applet API is deprecated. See the java.applet package documentation for further information.
jdk.jfr.FlightRecorderPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
jdk.jsobject
24
The jdk.jsobject module will be delivered with JavaFX.
jdk.jstatd
24
jdk.net.NetworkPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
jdk.net.Sockets.supportedOptions(Class<?>)
16
use `Socket.supportedOptions()`, `ServerSocket.supportedOptions()`, or `DatagramSocket.supportedOptions()` instead.
netscape.javascript.JSException
24
The jdk.jsobject module will be delivered with JavaFX.
netscape.javascript.JSObject
24
The jdk.jsobject module will be delivered with JavaFX.

Deprecated Modules
Module
Deprecated in
Description
jdk.jsobject
24
The jdk.jsobject module will be delivered with JavaFX.
jdk.jstatd
24

Deprecated Interfaces
Interface
Deprecated in
Description
java.applet.AppletContext
9
The Applet API is deprecated, no replacement.
java.applet.AppletStub
9
The Applet API is deprecated, no replacement.
java.applet.AudioClip
9
The Applet API is deprecated, no replacement.
java.beans.AppletInitializer
9
The Applet API is deprecated. See the java.applet package documentation for further information.
java.beans.beancontext.BeanContext
23
java.beans.beancontext.BeanContextChild
23
java.beans.beancontext.BeanContextChildComponentProxy
23
java.beans.beancontext.BeanContextContainerProxy
23
java.beans.beancontext.BeanContextMembershipListener
23
java.beans.beancontext.BeanContextProxy
23
java.beans.beancontext.BeanContextServiceProvider
23
java.beans.beancontext.BeanContextServiceProviderBeanInfo
23
java.beans.beancontext.BeanContextServiceRevokedListener
23
java.beans.beancontext.BeanContextServices
23
java.beans.beancontext.BeanContextServicesListener
23
java.rmi.registry.RegistryHandler
no replacement
java.rmi.server.LoaderHandler
no replacement
java.rmi.server.RemoteCall
no replacement.
java.rmi.server.ServerRef
No replacement. This interface is unused and is obsolete.
java.rmi.server.Skeleton
no replacement. Skeletons are no longer required for remote method calls in the Java 2 platform v1.2 and greater.
java.security.Certificate
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.cert.Certificate` and related classes.
java.security.DomainCombiner
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.Policy.Parameters
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.util.logging.LoggingMXBean
9
`LoggingMXBean` is no longer a `platform MXBean` and is replaced with `PlatformLoggingMXBean`. It will not register in the platform `MBeanServer`. Use `ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class)` instead.
java.util.Observer
9
This interface has been deprecated. See the `Observable` class for further information.
org.xml.sax.AttributeList
1.5
This interface has been replaced by the SAX2 `Attributes` interface, which includes Namespace support.
org.xml.sax.DocumentHandler
1.5
This interface has been replaced by the SAX2 `ContentHandler` interface, which includes Namespace support.
org.xml.sax.Parser
1.5
This interface has been replaced by the SAX2 `XMLReader` interface, which includes Namespace support.

Deprecated Classes
Class
Deprecated in
Description
com.sun.jdi.JDIPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
com.sun.security.jgss.InquireSecContextPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
com.sun.tools.attach.AttachPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
java.applet.Applet
9
The Applet API is deprecated, no replacement.
java.awt.AWTPermission
24
There is no replacement for this class.
java.awt.Event
9
It is recommended that `AWTEvent` and its subclasses be used instead
java.beans.beancontext.BeanContextChildSupport
23
java.beans.beancontext.BeanContextEvent
23
java.beans.beancontext.BeanContextMembershipEvent
23
java.beans.beancontext.BeanContextServiceAvailableEvent
23
java.beans.beancontext.BeanContextServiceRevokedEvent
23
java.beans.beancontext.BeanContextServicesSupport
23
java.beans.beancontext.BeanContextSupport
23
java.io.FilePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.io.LineNumberInputStream
This class incorrectly assumes that bytes adequately represent characters. As of JDK 1.1, the preferred way to operate on character streams is via the new character-stream classes, which include a class for counting line numbers.
java.io.SerializablePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.io.StringBufferInputStream
This class does not properly convert characters into bytes. As of JDK 1.1, the preferred way to create a stream from a string is via the `StringReader` class.
java.lang.management.ManagementPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
java.lang.reflect.ReflectPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.lang.RuntimePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.lang.SecurityManager
17
There is no replacement for this class.
java.net.NetPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.net.URLPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.nio.file.LinkPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.rmi.RMISecurityManager
1.8
There is no replacement for the Security Manager.
java.rmi.server.LogStream
no replacement
java.rmi.server.Operation
no replacement
java.rmi.server.RemoteStub
Statically generated stubs are deprecated, since stubs are generated dynamically. See `UnicastRemoteObject` for information about dynamic stub generation.
java.security.AccessControlContext
17
This class was only useful in conjunction with the the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.AccessController
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.Identity
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.KeyStore`, the `java.security.cert` package, and `java.security.Principal`.
java.security.IdentityScope
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.KeyStore`, the `java.security.cert` package, and `java.security.Principal`.
java.security.Policy
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. Installing a system-wide `Policy` object is no longer supported. The setPolicy method has been changed to always throw `UnsupportedOperationException`. The getPolicy method has been changed to always return a `Policy` object that grants no permissions. There is no replacement for the Security Manager or this class.
java.security.PolicySpi
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.security.SecurityPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.security.Signer
1.2
This class is deprecated and subject to removal in a future version of Java SE. It has been replaced by `java.security.KeyStore`, the `java.security.cert` package, and `java.security.Principal`.
java.security.UnresolvedPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.util.logging.LoggingPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
java.util.Observable
9
This class and the `Observer` interface have been deprecated. The event model supported by `Observer` and `Observable` is quite limited, the order of notifications delivered by `Observable` is unspecified, and state changes are not in one-for-one correspondence with notifications. For a richer event model, consider using the `java.beans` package. For reliable and ordered messaging among threads, consider using one of the concurrent data structures in the `java.util.concurrent` package. For reactive streams style programming, see the `Flow` API.
java.util.PropertyPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.accessibility.AccessibleResourceBundle
This class is deprecated as of version 1.3 of the Java Platform
javax.management.DefaultLoaderRepository
Use `MBeanServer.getClassLoaderRepository()` instead.
javax.management.loading.DefaultLoaderRepository
Use `MBeanServer.getClassLoaderRepository()` instead.
javax.management.MBeanPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.management.MBeanServerPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.management.MBeanTrustPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.management.remote.SubjectDelegationPermission
25
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for this class.
javax.net.ssl.SSLPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.AuthPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.kerberos.DelegationPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.kerberos.ServicePermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.PrivateCredentialPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
javax.security.auth.SubjectDomainCombiner
17
This class was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
javax.security.cert.Certificate
9
Use the classes in `java.security.cert` instead.
javax.security.cert.X509Certificate
9
Use the classes in `java.security.cert` instead.
javax.sound.sampled.AudioPermission
24
There is no replacement for this class.
javax.swing.JApplet
9
The Applet API is deprecated, no replacement.
javax.swing.JComponent.AccessibleJComponent.AccessibleFocusHandler
This class is no longer used or needed. `java.awt.Component.AccessibleAWTComponent` provides the same functionality and it is handled in `Component`.
javax.swing.plaf.basic.BasicMenuItemUI.MouseInputHandler
17
javax.swing.plaf.basic.BasicScrollPaneUI.HSBChangeListener
17
javax.swing.plaf.basic.BasicScrollPaneUI.PropertyChangeHandler
17
javax.swing.plaf.basic.BasicScrollPaneUI.ViewportChangeHandler
17
javax.swing.plaf.basic.BasicScrollPaneUI.VSBChangeListener
17
javax.swing.plaf.metal.MetalComboBoxUI.MetalComboPopup
As of Java 2 platform v1.4.
javax.swing.plaf.metal.MetalFileChooserUI.FileRenderer
9
As of JDK version 9. Obsolete class.
javax.swing.plaf.metal.MetalFileChooserUI.SingleClickListener
9
As of JDK version 9. Obsolete class.
javax.swing.text.DefaultTextUI
javax.swing.text.TableView.TableCell
A table cell can now be any View implementation.
jdk.jfr.FlightRecorderPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
jdk.net.NetworkPermission
25
This permission cannot be used for controlling access to resources as the Security Manager is no longer supported.
jdk.net.Sockets
16
Java SE 9 added standard methods to set/get socket options, and retrieve the per-Socket supported options effectively rendering this API redundant. Please refer to the corresponding socket's class for the equivalent method to set/get a socket option or retrieve available socket options.
netscape.javascript.JSObject
24
The jdk.jsobject module will be delivered with JavaFX.
org.xml.sax.HandlerBase
1.5
This class works with the deprecated `DocumentHandler` interface. It has been replaced by the SAX2 `DefaultHandler` class.
org.xml.sax.helpers.AttributeListImpl
1.5
This class implements a deprecated interface, `AttributeList`; that interface has been replaced by `Attributes`, which is implemented in the `AttributesImpl` helper class.
org.xml.sax.helpers.ParserFactory
1.5
This class works with the deprecated `Parser` interface.
org.xml.sax.helpers.XMLReaderFactory
9
It is recommended to use `SAXParserFactory` instead.

Deprecated Exception Classes
Exception Class
Deprecated in
Description
com.sun.jdi.InvalidCodeIndexException
This exception is no longer thrown
com.sun.jdi.InvalidLineNumberException
This exception is no longer thrown
java.lang.ThreadDeath
20
`Thread.stop()` was originally specified to "stop" a victim thread by causing the victim thread to throw a `ThreadDeath`. It was inherently unsafe and deprecated in an early JDK release. The ability to "stop" a thread with `Thread.stop` has been removed and the `Thread.stop` method changed to throw an exception. Consequently, `ThreadDeath` is also deprecated, for removal.
java.rmi.RMISecurityException
Use `SecurityException` instead. Application code should never directly reference this class, and `RMISecurityManager` no longer throws this subclass of `java.lang.SecurityException`.
java.rmi.server.SkeletonMismatchException
no replacement. Skeletons are no longer required for remote method calls in the Java 2 platform v1.2 and greater.
java.rmi.server.SkeletonNotFoundException
no replacement. Skeletons are no longer required for remote method calls in the Java 2 platform v1.2 and greater.
java.rmi.server.SocketSecurityException
This class is obsolete. Use `ExportException` instead.
java.rmi.ServerRuntimeException
no replacement
java.security.AccessControlException
17
This exception was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this class.
java.util.zip.ZipError
24
ZipError is no longer used and is obsolete. `ZipException` should be used instead.
javax.management.modelmbean.XMLParseException
25
This class exists only to support XML parsing implemented privately in this module, in DescriptorSupport. That feature is deprecated for removal.
javax.security.cert.CertificateEncodingException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateExpiredException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateNotYetValidException
9
Use the classes in `java.security.cert` instead.
javax.security.cert.CertificateParsingException
9
Use the classes in `java.security.cert` instead.
netscape.javascript.JSException
24
The jdk.jsobject module will be delivered with JavaFX.

Deprecated Fields
Field
Deprecated in
Description
java.awt.Cursor.predefined
As of JDK version 1.7, the `Cursor.getPredefinedCursor(int)` method should be used instead.
java.awt.datatransfer.DataFlavor.plainTextFlavor
as of 1.3. Use `DataFlavor.getReaderForText(Transferable)` instead of `Transferable.getTransferData(DataFlavor.plainTextFlavor)`.
java.awt.event.InputEvent.ALT_GRAPH_MASK
9
It is recommended that ALT_GRAPH_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead
java.awt.event.InputEvent.ALT_MASK
9
It is recommended that ALT_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead
java.awt.event.InputEvent.BUTTON1_MASK
9
It is recommended that BUTTON1_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead
java.awt.event.InputEvent.BUTTON2_MASK
9
It is recommended that BUTTON2_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead. Note that BUTTON2_MASK has the same value as ALT_MASK.
java.awt.event.InputEvent.BUTTON3_MASK
9
It is recommended that BUTTON3_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead. Note that BUTTON3_MASK has the same value as META_MASK.
java.awt.event.InputEvent.CTRL_MASK
9
It is recommended that CTRL_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead
java.awt.event.InputEvent.META_MASK
9
It is recommended that META_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead
java.awt.event.InputEvent.SHIFT_MASK
9
It is recommended that SHIFT_DOWN_MASK and `InputEvent.getModifiersEx()` be used instead
java.awt.Frame.CROSSHAIR_CURSOR
replaced by `Cursor.CROSSHAIR_CURSOR`.
java.awt.Frame.DEFAULT_CURSOR
replaced by `Cursor.DEFAULT_CURSOR`.
java.awt.Frame.E_RESIZE_CURSOR
replaced by `Cursor.E_RESIZE_CURSOR`.
java.awt.Frame.HAND_CURSOR
replaced by `Cursor.HAND_CURSOR`.
java.awt.Frame.MOVE_CURSOR
replaced by `Cursor.MOVE_CURSOR`.
java.awt.Frame.N_RESIZE_CURSOR
replaced by `Cursor.N_RESIZE_CURSOR`.
java.awt.Frame.NE_RESIZE_CURSOR
replaced by `Cursor.NE_RESIZE_CURSOR`.
java.awt.Frame.NW_RESIZE_CURSOR
replaced by `Cursor.NW_RESIZE_CURSOR`.
java.awt.Frame.S_RESIZE_CURSOR
replaced by `Cursor.S_RESIZE_CURSOR`.
java.awt.Frame.SE_RESIZE_CURSOR
replaced by `Cursor.SE_RESIZE_CURSOR`.
java.awt.Frame.SW_RESIZE_CURSOR
replaced by `Cursor.SW_RESIZE_CURSOR`.
java.awt.Frame.TEXT_CURSOR
replaced by `Cursor.TEXT_CURSOR`.
java.awt.Frame.W_RESIZE_CURSOR
replaced by `Cursor.W_RESIZE_CURSOR`.
java.awt.Frame.WAIT_CURSOR
replaced by `Cursor.WAIT_CURSOR`.
java.io.WriteAbortedException.detail
17
This field predates the general-purpose exception chaining facility. The `Throwable.getCause()` method is now the preferred means of obtaining this information.
java.lang.Character.UnicodeBlock.SURROGATES_AREA
1.5
Instead of `SURROGATES_AREA`, use `Character.UnicodeBlock.HIGH_SURROGATES`, `Character.UnicodeBlock.HIGH_PRIVATE_USE_SURROGATES`, and `Character.UnicodeBlock.LOW_SURROGATES`. These constants match the block definitions of the Unicode Standard. The `Character.UnicodeBlock.of(char)` and `Character.UnicodeBlock.of(int)` methods return the standard constants.
java.math.BigDecimal.ROUND_CEILING
9
Use `RoundingMode.CEILING` instead.
java.math.BigDecimal.ROUND_DOWN
9
Use `RoundingMode.DOWN` instead.
java.math.BigDecimal.ROUND_FLOOR
9
Use `RoundingMode.FLOOR` instead.
java.math.BigDecimal.ROUND_HALF_DOWN
9
Use `RoundingMode.HALF_DOWN` instead.
java.math.BigDecimal.ROUND_HALF_EVEN
9
Use `RoundingMode.HALF_EVEN` instead.
java.math.BigDecimal.ROUND_HALF_UP
9
Use `RoundingMode.HALF_UP` instead.
java.math.BigDecimal.ROUND_UNNECESSARY
9
Use `RoundingMode.UNNECESSARY` instead.
java.math.BigDecimal.ROUND_UP
9
Use `RoundingMode.UP` instead.
java.net.HttpURLConnection.HTTP_SERVER_ERROR
it is misplaced and shouldn't have existed.
java.rmi.server.RemoteRef.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.rmi.server.ServerRef.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.DSAPrivateKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.DSAPublicKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.ECPrivateKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.ECPublicKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.RSAMultiPrimePrivateCrtKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.RSAPrivateCrtKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.RSAPrivateKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.interfaces.RSAPublicKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.Key.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.PrivateKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.PublicKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
java.security.spec.PSSParameterSpec.DEFAULT
19
This field uses the default values defined in the PKCS #1 standard. Some of these defaults are no longer recommended due to advances in cryptanalysis -- see the PKCS#1 v2.2 standard for more details. Thus, it is recommended to create a new `PSSParameterSpec` with the desired parameter values using the `PSSParameterSpec(String, String, AlgorithmParameterSpec, int, int)` constructor.
java.util.jar.Attributes.Name.EXTENSION_INSTALLATION
Extension mechanism is no longer supported.
java.util.jar.Attributes.Name.IMPLEMENTATION_URL
Extension mechanism is no longer supported.
java.util.jar.Attributes.Name.IMPLEMENTATION_VENDOR_ID
Extension mechanism is no longer supported.
java.util.logging.Logger.global
Initialization of this field is prone to deadlocks. The field must be initialized by the Logger class initialization which may cause deadlocks with the LogManager class initialization. In such cases two class initialization wait for each other to complete. The preferred way to get the global logger object is via the call `Logger.getGlobal()`. For compatibility with old JDK versions where the `Logger.getGlobal()` is not available use the call `Logger.getLogger(Logger.GLOBAL_LOGGER_NAME)` or `Logger.getLogger("global")`.
javax.crypto.interfaces.DHPrivateKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
javax.crypto.interfaces.DHPublicKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
javax.crypto.interfaces.PBEKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
javax.crypto.SecretKey.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
javax.crypto.spec.OAEPParameterSpec.DEFAULT
19
This field uses the default values defined in the PKCS #1 standard. Some of these defaults are no longer recommended due to advances in cryptanalysis -- see Appendix B.1 of PKCS #1 for more details. Thus, it is recommended to create a new `OAEPParameterSpec` with the desired parameter values using the `OAEPParameterSpec(String, String, AlgorithmParameterSpec, PSource)` constructor.
javax.imageio.spi.ImageReaderSpi.STANDARD_INPUT_TYPE
Instead of using this field, directly create the equivalent array `{ ImageInputStream.class }`.
javax.imageio.spi.ImageWriterSpi.STANDARD_OUTPUT_TYPE
Instead of using this field, directly create the equivalent array `{ ImageOutputStream.class }`.
javax.management.monitor.Monitor.alreadyNotified
equivalent to `Monitor.alreadyNotifieds`[0].
javax.management.monitor.Monitor.dbgTag
No replacement.
javax.management.openmbean.OpenType.ALLOWED_CLASSNAMES
Use `ALLOWED_CLASSNAMES_LIST` instead.
javax.naming.directory.Attribute.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
javax.naming.Name.serialVersionUID
A `serialVersionUID` field in an interface is ineffectual. Do not use; no replacement.
javax.sql.rowset.CachedRowSet.COMMIT_ON_ACCEPT_CHANGES
Because this field is final (it is part of an interface), its value cannot be changed.
javax.swing.ImageIcon.component
since 1.8
javax.swing.ImageIcon.tracker
since 1.8
javax.swing.JComponent.AccessibleJComponent.accessibleFocusHandler
javax.swing.JViewport.backingStore
As of Java 2 platform v1.3
javax.swing.plaf.basic.BasicDesktopPaneUI.closeKey
As of 1.3.
javax.swing.plaf.basic.BasicDesktopPaneUI.maximizeKey
As of 1.3.
javax.swing.plaf.basic.BasicDesktopPaneUI.minimizeKey
As of 1.3.
javax.swing.plaf.basic.BasicDesktopPaneUI.navigateKey
As of 1.3.
javax.swing.plaf.basic.BasicDesktopPaneUI.navigateKey2
As of 1.3.
javax.swing.plaf.basic.BasicInternalFrameUI.openMenuKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.dividerResizeToggleKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.downKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.endKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.homeKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.keyboardDownRightListener
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.keyboardEndListener
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.keyboardHomeListener
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.keyboardResizeToggleListener
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.keyboardUpLeftListener
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.leftKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.rightKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.upKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicTabbedPaneUI.downKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicTabbedPaneUI.leftKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicTabbedPaneUI.rightKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicTabbedPaneUI.upKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicToolBarUI.downKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicToolBarUI.leftKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicToolBarUI.rightKey
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicToolBarUI.upKey
As of Java 2 platform v1.3.
javax.swing.table.TableColumn.resizedPostingDisableCount
as of Java 2 platform v1.3
javax.swing.text.html.FormView.RESET
As of 1.3, value comes from UIManager UIManager property FormView.resetButtonText
javax.swing.text.html.FormView.SUBMIT
As of 1.3, value now comes from UIManager property FormView.submitButtonText

Deprecated Methods
Method
Deprecated in
Description
com.sun.jdi.VirtualMachine.canAddMethod()
15
A JVM TI based JDWP back-end will never set this capability to true.
com.sun.jdi.VirtualMachine.canUnrestrictedlyRedefineClasses()
15
A JVM TI based JDWP back-end will never set this capability to true.
com.sun.management.OperatingSystemMXBean.getFreePhysicalMemorySize()
14
Use `OperatingSystemMXBean.getFreeMemorySize()` instead of this historically named method.
com.sun.management.OperatingSystemMXBean.getSystemCpuLoad()
14
Use `OperatingSystemMXBean.getCpuLoad()` instead of this historically named method.
com.sun.management.OperatingSystemMXBean.getTotalPhysicalMemorySize()
14
Use `OperatingSystemMXBean.getTotalMemorySize()` instead of this historically named method.
com.sun.net.httpserver.HttpsParameters.getCipherSuites()
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`.
com.sun.net.httpserver.HttpsParameters.getNeedClientAuth()
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`.
com.sun.net.httpserver.HttpsParameters.getProtocols()
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`.
com.sun.net.httpserver.HttpsParameters.getWantClientAuth()
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`.
com.sun.net.httpserver.HttpsParameters.setCipherSuites(String[])
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`. Use `SSLParameters.setCipherSuites(String[])` instead.
com.sun.net.httpserver.HttpsParameters.setNeedClientAuth(boolean)
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`. Use `SSLParameters.setNeedClientAuth(boolean)` instead.
com.sun.net.httpserver.HttpsParameters.setProtocols(String[])
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`. Use `SSLParameters.setProtocols(String[])` instead.
com.sun.net.httpserver.HttpsParameters.setWantClientAuth(boolean)
23
It is recommended that the SSL parameters be configured and read through the use of `SSLParameters`. Use `SSLParameters.setWantClientAuth(boolean)` instead.
com.sun.source.tree.CaseTree.getExpression()
Please use `CaseTree.getExpressions()`.
java.awt.AWTKeyStroke.registerSubclass(Class<?>)
java.awt.BorderLayout.addLayoutComponent(String, Component)
replaced by `addLayoutComponent(Component, Object)`.
java.awt.CardLayout.addLayoutComponent(String, Component)
replaced by `addLayoutComponent(Component, Object)`.
java.awt.CheckboxGroup.getCurrent()
As of JDK version 1.1, replaced by `getSelectedCheckbox()`.
java.awt.CheckboxGroup.setCurrent(Checkbox)
As of JDK version 1.1, replaced by `setSelectedCheckbox(Checkbox)`.
java.awt.Choice.countItems()
As of JDK version 1.1, replaced by `getItemCount()`.
java.awt.Component.action(Event, Object)
As of JDK version 1.1, should register this component as ActionListener on component which fires action events.
java.awt.Component.bounds()
As of JDK version 1.1, replaced by `getBounds()`.
java.awt.Component.deliverEvent(Event)
As of JDK version 1.1, replaced by `dispatchEvent(AWTEvent e)`.
java.awt.Component.disable()
As of JDK version 1.1, replaced by `setEnabled(boolean)`.
java.awt.Component.enable()
As of JDK version 1.1, replaced by `setEnabled(boolean)`.
java.awt.Component.enable(boolean)
As of JDK version 1.1, replaced by `setEnabled(boolean)`.
java.awt.Component.gotFocus(Event, Object)
As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).
java.awt.Component.handleEvent(Event)
As of JDK version 1.1 replaced by processEvent(AWTEvent).
java.awt.Component.hide()
As of JDK version 1.1, replaced by `setVisible(boolean)`.
java.awt.Component.inside(int, int)
As of JDK version 1.1, replaced by contains(int, int).
java.awt.Component.isFocusTraversable()
As of 1.4, replaced by `isFocusable()`.
java.awt.Component.keyDown(Event, int)
As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).
java.awt.Component.keyUp(Event, int)
As of JDK version 1.1, replaced by processKeyEvent(KeyEvent).
java.awt.Component.layout()
As of JDK version 1.1, replaced by `doLayout()`.
java.awt.Component.locate(int, int)
As of JDK version 1.1, replaced by getComponentAt(int, int).
java.awt.Component.location()
As of JDK version 1.1, replaced by `getLocation()`.
java.awt.Component.lostFocus(Event, Object)
As of JDK version 1.1, replaced by processFocusEvent(FocusEvent).
java.awt.Component.minimumSize()
As of JDK version 1.1, replaced by `getMinimumSize()`.
java.awt.Component.mouseDown(Event, int, int)
As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
java.awt.Component.mouseDrag(Event, int, int)
As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).
java.awt.Component.mouseEnter(Event, int, int)
As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
java.awt.Component.mouseExit(Event, int, int)
As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
java.awt.Component.mouseMove(Event, int, int)
As of JDK version 1.1, replaced by processMouseMotionEvent(MouseEvent).
java.awt.Component.mouseUp(Event, int, int)
As of JDK version 1.1, replaced by processMouseEvent(MouseEvent).
java.awt.Component.move(int, int)
As of JDK version 1.1, replaced by `setLocation(int, int)`.
java.awt.Component.nextFocus()
As of JDK version 1.1, replaced by transferFocus().
java.awt.Component.postEvent(Event)
As of JDK version 1.1, replaced by dispatchEvent(AWTEvent).
java.awt.Component.preferredSize()
As of JDK version 1.1, replaced by `getPreferredSize()`.
java.awt.Component.reshape(int, int, int, int)
As of JDK version 1.1, replaced by `setBounds(int, int, int, int)`.
java.awt.Component.resize(int, int)
As of JDK version 1.1, replaced by `setSize(int, int)`.
java.awt.Component.resize(Dimension)
As of JDK version 1.1, replaced by `setSize(Dimension)`.
java.awt.Component.show()
As of JDK version 1.1, replaced by `setVisible(boolean)`.
java.awt.Component.show(boolean)
As of JDK version 1.1, replaced by `setVisible(boolean)`.
java.awt.Component.size()
As of JDK version 1.1, replaced by `getSize()`.
java.awt.ComponentOrientation.getOrientation(ResourceBundle)
As of J2SE 1.4, use `ComponentOrientation.getOrientation(java.util.Locale)`.
java.awt.Container.countComponents()
As of JDK version 1.1, replaced by getComponentCount().
java.awt.Container.deliverEvent(Event)
As of JDK version 1.1, replaced by `dispatchEvent(AWTEvent e)`
java.awt.Container.insets()
As of JDK version 1.1, replaced by `getInsets()`.
java.awt.Container.layout()
As of JDK version 1.1, replaced by `doLayout()`.
java.awt.Container.locate(int, int)
As of JDK version 1.1, replaced by `getComponentAt(int, int)`.
java.awt.Container.minimumSize()
As of JDK version 1.1, replaced by `getMinimumSize()`.
java.awt.Container.preferredSize()
As of JDK version 1.1, replaced by `getPreferredSize()`.
java.awt.datatransfer.DataFlavor.equals(String)
As inconsistent with `hashCode()` contract, use `DataFlavor.isMimeTypeEqual(String)` instead.
java.awt.datatransfer.DataFlavor.normalizeMimeType(String)
This method is never invoked by this implementation from 1.1 onwards
java.awt.datatransfer.DataFlavor.normalizeMimeTypeParameter(String, String)
This method is never invoked by this implementation from 1.1 onwards
java.awt.Dialog.hide()
As of JDK version 1.5, replaced by `setVisible(boolean)`.
java.awt.Dialog.show()
As of JDK version 1.5, replaced by `setVisible(boolean)`.
java.awt.event.InputEvent.getModifiers()
9
It is recommended that extended modifier keys and `InputEvent.getModifiersEx()` be used instead
java.awt.event.KeyEvent.getKeyModifiersText(int)
9
It is recommended that extended modifier keys and `InputEvent.getModifiersExText(int)` be used instead
java.awt.event.KeyEvent.setModifiers(int)
as of JDK1.1.4
java.awt.FontMetrics.getMaxDecent()
As of JDK version 1.1.1, replaced by `getMaxDescent()`.
java.awt.Frame.getCursorType()
As of JDK version 1.1, replaced by `Component.getCursor()`.
java.awt.Frame.setCursor(int)
As of JDK version 1.1, replaced by `Component.setCursor(Cursor)`.
java.awt.Graphics.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.awt.Graphics.getClipRect()
As of JDK version 1.1, replaced by `getClipBounds()`.
java.awt.image.renderable.RenderContext.concetenateTransform(AffineTransform)
replaced by `concatenateTransform(AffineTransform)`.
java.awt.image.renderable.RenderContext.preConcetenateTransform(AffineTransform)
replaced by `preConcatenateTransform(AffineTransform)`.
java.awt.List.addItem(String)
replaced by `add(String)`.
java.awt.List.addItem(String, int)
replaced by `add(String, int)`.
java.awt.List.allowsMultipleSelections()
As of JDK version 1.1, replaced by `isMultipleMode()`.
java.awt.List.clear()
As of JDK version 1.1, replaced by `removeAll()`.
java.awt.List.countItems()
As of JDK version 1.1, replaced by `getItemCount()`.
java.awt.List.delItem(int)
replaced by `remove(String)` and `remove(int)`.
java.awt.List.delItems(int, int)
As of JDK version 1.1, Not for public use in the future. This method is expected to be retained only as a package private method.
java.awt.List.isSelected(int)
As of JDK version 1.1, replaced by `isIndexSelected(int)`.
java.awt.List.minimumSize()
As of JDK version 1.1, replaced by `getMinimumSize()`.
java.awt.List.minimumSize(int)
As of JDK version 1.1, replaced by `getMinimumSize(int)`.
java.awt.List.preferredSize()
As of JDK version 1.1, replaced by `getPreferredSize()`.
java.awt.List.preferredSize(int)
As of JDK version 1.1, replaced by `getPreferredSize(int)`.
java.awt.List.setMultipleSelections(boolean)
As of JDK version 1.1, replaced by `setMultipleMode(boolean)`.
java.awt.Menu.countItems()
As of JDK version 1.1, replaced by `getItemCount()`.
java.awt.MenuBar.countMenus()
As of JDK version 1.1, replaced by `getMenuCount()`.
java.awt.MenuComponent.postEvent(Event)
As of JDK version 1.1, replaced by `dispatchEvent`.
java.awt.MenuContainer.postEvent(Event)
As of JDK version 1.1 replaced by dispatchEvent(AWTEvent).
java.awt.MenuItem.disable()
As of JDK version 1.1, replaced by `setEnabled(boolean)`.
java.awt.MenuItem.enable()
As of JDK version 1.1, replaced by `setEnabled(boolean)`.
java.awt.MenuItem.enable(boolean)
As of JDK version 1.1, replaced by `setEnabled(boolean)`.
java.awt.Polygon.getBoundingBox()
As of JDK version 1.1, replaced by `getBounds()`.
java.awt.Polygon.inside(int, int)
As of JDK version 1.1, replaced by `contains(int, int)`.
java.awt.PrintJob.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.awt.Rectangle.inside(int, int)
As of JDK version 1.1, replaced by `contains(int, int)`.
java.awt.Rectangle.move(int, int)
As of JDK version 1.1, replaced by `setLocation(int, int)`.
java.awt.Rectangle.reshape(int, int, int, int)
As of JDK version 1.1, replaced by `setBounds(int, int, int, int)`.
java.awt.Rectangle.resize(int, int)
As of JDK version 1.1, replaced by `setSize(int, int)`.
java.awt.Scrollbar.getLineIncrement()
As of JDK version 1.1, replaced by `getUnitIncrement()`.
java.awt.Scrollbar.getPageIncrement()
As of JDK version 1.1, replaced by `getBlockIncrement()`.
java.awt.Scrollbar.getVisible()
As of JDK version 1.1, replaced by `getVisibleAmount()`.
java.awt.Scrollbar.setLineIncrement(int)
As of JDK version 1.1, replaced by `setUnitIncrement(int)`.
java.awt.Scrollbar.setPageIncrement(int)
As of JDK version 1.1, replaced by `setBlockIncrement()`.
java.awt.ScrollPane.layout()
As of JDK version 1.1, replaced by `doLayout()`.
java.awt.TextArea.appendText(String)
As of JDK version 1.1, replaced by `append(String)`.
java.awt.TextArea.insertText(String, int)
As of JDK version 1.1, replaced by `insert(String, int)`.
java.awt.TextArea.minimumSize()
As of JDK version 1.1, replaced by `getMinimumSize()`.
java.awt.TextArea.minimumSize(int, int)
As of JDK version 1.1, replaced by `getMinimumSize(int, int)`.
java.awt.TextArea.preferredSize()
As of JDK version 1.1, replaced by `getPreferredSize()`.
java.awt.TextArea.preferredSize(int, int)
As of JDK version 1.1, replaced by `getPreferredSize(int, int)`.
java.awt.TextArea.replaceText(String, int, int)
As of JDK version 1.1, replaced by `replaceRange(String, int, int)`.
java.awt.TextField.minimumSize()
As of JDK version 1.1, replaced by `getMinimumSize()`.
java.awt.TextField.minimumSize(int)
As of JDK version 1.1, replaced by `getMinimumSize(int)`.
java.awt.TextField.preferredSize()
As of JDK version 1.1, replaced by `getPreferredSize()`.
java.awt.TextField.preferredSize(int)
As of JDK version 1.1, replaced by `getPreferredSize(int)`.
java.awt.TextField.setEchoCharacter(char)
As of JDK version 1.1, replaced by `setEchoChar(char)`.
java.awt.Toolkit.getFontList()
see `GraphicsEnvironment.getAvailableFontFamilyNames()`
java.awt.Toolkit.getFontMetrics(Font)
As of JDK version 1.2, replaced by the `Font` method `getLineMetrics`.
java.awt.Toolkit.getMenuShortcutKeyMask()
10
It is recommended that extended modifier keys and `Toolkit.getMenuShortcutKeyMaskEx()` be used instead
java.awt.Window.applyResourceBundle(String)
As of J2SE 1.4, replaced by `Component.applyComponentOrientation`.
java.awt.Window.applyResourceBundle(ResourceBundle)
As of J2SE 1.4, replaced by `Component.applyComponentOrientation`.
java.awt.Window.getWarningString()
24
since JDK 24
java.awt.Window.hide()
As of JDK version 1.5, replaced by `Window.setVisible(boolean)`.
java.awt.Window.postEvent(Event)
As of JDK version 1.1 replaced by `dispatchEvent(AWTEvent)`.
java.awt.Window.reshape(int, int, int, int)
As of JDK version 1.1, replaced by `setBounds(int, int, int, int)`.
java.awt.Window.show()
As of JDK version 1.5, replaced by `Window.setVisible(boolean)`.
java.beans.Beans.instantiate(ClassLoader, String, BeanContext)
23
this method will be removed when java.beans.beancontext is removed
java.beans.Beans.instantiate(ClassLoader, String, BeanContext, AppletInitializer)
9
It is recommended to use `Beans.instantiate(ClassLoader, String, BeanContext)`, because the Applet API is deprecated. See the java.applet package documentation for further information.
java.io.ByteArrayOutputStream.toString(int)
This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the `ByteArrayOutputStream.toString(String charsetName)` or `ByteArrayOutputStream.toString(Charset charset)` method, which takes an encoding-name or charset argument, or the `toString()` method, which uses the default charset.
java.io.DataInputStream.readLine()
This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the `BufferedReader.readLine()` method. Programs that use the `DataInputStream` class to read lines can be converted to use the `BufferedReader` class by replacing code of the form:

>         DataInputStream d = new DataInputStream(in);

with:

>         BufferedReader d
>              = new BufferedReader(new InputStreamReader(in));

java.io.File.toURL()
This method does not automatically escape characters that are illegal in URLs. It is recommended that new code convert an abstract pathname into a URL by first converting it into a URI, via the `toURI` method, and then converting the URI into a URL via the `URI.toURL` method.
java.io.ObjectInputStream.readLine()
This method does not properly convert bytes to characters. see DataInputStream for the details and alternatives.
java.io.ObjectOutputStream.PutField.write(ObjectOutput)
1.4
This method does not write the values contained by this `PutField` object in a proper format, and may result in corruption of the serialization stream. The correct way to write `PutField` data is by calling the `ObjectOutputStream.writeFields()` method.
java.lang.Character.isJavaLetter(char)
1.1
Replaced by isJavaIdentifierStart(char).
java.lang.Character.isJavaLetterOrDigit(char)
1.1
Replaced by isJavaIdentifierPart(char).
java.lang.Character.isSpace(char)
1.1
Replaced by isWhitespace(char).
java.lang.Class.newInstance()
9
This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The `Constructor.newInstance` method avoids this problem by wrapping any exception thrown by the constructor in a (checked) `InvocationTargetException`.

The call

    clazz.newInstance()

can be replaced by

    clazz.getDeclaredConstructor().newInstance()

The latter sequence of calls is inferred to be able to throw the additional exception types `InvocationTargetException` and `NoSuchMethodException`. Both of these exception types are subclasses of `ReflectiveOperationException`.
java.lang.ClassLoader.defineClass(byte[], int, int)
1.1
Replaced by `defineClass(String, byte[], int, int)`
java.lang.ClassLoader.getPackage(String)
9
If multiple class loaders delegate to each other and define classes with the same package name, and one such loader relies on the lookup behavior of `getPackage` to return a `Package` from a parent loader, then the properties exposed by the `Package` may not be as expected in the rest of the program. For example, the `Package` will only expose annotations from the `package-info.class` file defined by the parent loader, even if annotations exist in a `package-info.class` file defined by a child loader. A more robust approach is to use the `ClassLoader.getDefinedPackage(String)` method which returns a `Package` for the specified class loader.
java.lang.Enum.finalize()
18
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.lang.invoke.MethodHandles.Lookup.hasPrivateAccess()
14
This method was originally designed to test `PRIVATE` access that implies full privilege access but `MODULE` access has since become independent of `PRIVATE` access. It is recommended to call `MethodHandles.Lookup.hasFullPrivilegeAccess()` instead.
java.lang.management.MemoryMXBean.getObjectPendingFinalizationCount()
18
Finalization has been deprecated for removal. See `Object.finalize()` for details.
java.lang.Object.finalize()
9
Finalization is deprecated and subject to removal in a future release. The use of finalization can lead to problems with security, performance, and reliability. See JEP 421 for discussion and alternatives.

Subclasses that override `finalize` to perform cleanup should use alternative cleanup mechanisms and remove the `finalize` method. Use `Cleaner` and `PhantomReference` as safer ways to release resources when an object becomes unreachable. Alternatively, add a `close` method to explicitly release resources, and implement `AutoCloseable` to enable use of the `try`-with-resources statement.

This method will remain in place until finalizers have been removed from most existing code.

java.lang.Package.getPackage(String)
9
If multiple class loaders delegate to each other and define classes with the same package name, and one such loader relies on the lookup behavior of `getPackage` to return a `Package` from a parent loader, then the properties exposed by the `Package` may not be as expected in the rest of the program. For example, the `Package` will only expose annotations from the `package-info.class` file defined by the parent loader, even if annotations exist in a `package-info.class` file defined by a child loader. A more robust approach is to use the `ClassLoader.getDefinedPackage(String)` method which returns a `Package` for the specified class loader.
java.lang.ref.Reference.isEnqueued()
16
This method was originally specified to test if a reference object has been cleared and enqueued but was never implemented to do this test. This method could be misused due to the inherent race condition or without an associated `ReferenceQueue`. An application relying on this method to release critical resources could cause serious performance issue. An application should use `ReferenceQueue` to reliably determine what reference objects that have been enqueued or `refersTo(null)` to determine if this reference object has been cleared.
java.lang.reflect.AccessibleObject.isAccessible()
9
This method is deprecated because its name hints that it checks if the reflected object is accessible when it actually indicates if the checks for Java language access control are suppressed. This method may return `false` on a reflected object that is accessible to the caller. To test if this reflected object is accessible, it should use `AccessibleObject.canAccess(Object)`.
java.lang.reflect.Proxy.getProxyClass(ClassLoader, Class<?>...)
Proxy classes generated in a named module are encapsulated and not accessible to code outside its module. `Constructor.newInstance` will throw `IllegalAccessException` when it is called on an inaccessible proxy class. Use `Proxy.newProxyInstance(ClassLoader, Class[], InvocationHandler)` to create a proxy instance instead.
java.lang.Runtime.exec(String)
18
This method is error-prone and should not be used, the corresponding method `Runtime.exec(String[])` or `ProcessBuilder` should be used instead. The command string is broken into tokens using only whitespace characters. For an argument with an embedded space, such as a filename, this can cause problems as the token does not include the full filename.
java.lang.Runtime.exec(String, String[])
18
This method is error-prone and should not be used, the corresponding method `Runtime.exec(String[], String[])` or `ProcessBuilder` should be used instead. The command string is broken into tokens using only whitespace characters. For an argument with an embedded space, such as a filename, this can cause problems as the token does not include the full filename.
java.lang.Runtime.exec(String, String[], File)
18
This method is error-prone and should not be used, the corresponding method `Runtime.exec(String[], String[], File)` or `ProcessBuilder` should be used instead. The command string is broken into tokens using only whitespace characters. For an argument with an embedded space, such as a filename, this can cause problems as the token does not include the full filename.
java.lang.Runtime.runFinalization()
18
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.

When running in a JVM in which finalization has been disabled or removed, no objects will be pending finalization, so this method does nothing.

java.lang.Runtime.Version.major()
10
As of Java SE 10, the first element of a version number is not the major-release number but the feature-release counter, incremented for every time-based release. Use the `Runtime.Version.feature()` method in preference to this method. For compatibility, this method returns the value of the feature element.
java.lang.Runtime.Version.minor()
10
As of Java SE 10, the second element of a version number is not the minor-release number but the interim-release counter, incremented for every interim release. Use the `Runtime.Version.interim()` method in preference to this method. For compatibility, this method returns the value of the interim element, or zero if it is absent.
java.lang.Runtime.Version.security()
10
As of Java SE 10, the third element of a version number is not the security level but the update-release counter, incremented for every update release. Use the `Runtime.Version.update()` method in preference to this method. For compatibility, this method returns the value of the update element, or zero if it is absent.
java.lang.String.getBytes(int, int, byte[], int)
1.1
This method does not properly convert characters into bytes. As of JDK 1.1, the preferred way to do this is via the `String.getBytes()` method, which uses the `default charset`.
java.lang.System.getSecurityManager()
17
This method originally returned the system-wide Security Manager. Setting a Security Manager is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.System.runFinalization()
18
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.

When running in a JVM in which finalization has been disabled or removed, no objects will be pending finalization, so this method does nothing.

java.lang.System.setSecurityManager(SecurityManager)
17
This method originally set the system-wide Security Manager. Setting a Security Manager is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.Thread.checkAccess()
17
This method originally determined if the currently running thread had permission to modify this thread. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.Thread.getId()
19
This method is not final and may be overridden to return a value that is not the thread ID. Use `Thread.threadId()` instead.
java.lang.Thread.stop()
1.2
This method was originally specified to "stop" a victim thread by causing the victim thread to throw a `ThreadDeath`. It was inherently unsafe. Stopping a thread caused it to unlock all of the monitors that it had locked (as a natural consequence of the `ThreadDeath` exception propagating up the stack). If any of the objects previously protected by these monitors were in an inconsistent state, the damaged objects became visible to other threads, potentially resulting in arbitrary behavior. Usages of `stop` should be replaced by code that simply modifies some variable to indicate that the target thread should stop running. The target thread should check this variable regularly, and return from its run method in an orderly fashion if the variable indicates that it is to stop running. If the target thread waits for long periods (on a condition variable, for example), the `interrupt` method should be used to interrupt the wait. For more information, see Why is Thread.stop deprecated and the ability to stop a thread removed?.
java.lang.ThreadGroup.checkAccess()
17
This method originally determined if the currently running thread had permission to modify this thread group. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.lang.ThreadGroup.destroy()
16
This method was originally specified to destroy an empty thread group. The ability to explicitly destroy a thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.lang.ThreadGroup.isDaemon()
16
This method originally indicated if the thread group is a daemon thread group that is automatically destroyed when its last thread terminates. The concept of daemon thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.lang.ThreadGroup.isDestroyed()
16
This method originally indicated if the thread group is destroyed. The ability to destroy a thread group and the concept of a destroyed thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.lang.ThreadGroup.setDaemon(boolean)
16
This method originally configured whether the thread group is a daemon thread group that is automatically destroyed when its last thread terminates. The concept of daemon thread group no longer exists. A thread group is eligible to be GC'ed when there are no live threads in the group and it is otherwise unreachable.
java.math.BigDecimal.divide(BigDecimal, int)
9
The method `BigDecimal.divide(BigDecimal, RoundingMode)` should be used in preference to this legacy method.
java.math.BigDecimal.divide(BigDecimal, int, int)
9
The method `BigDecimal.divide(BigDecimal, int, RoundingMode)` should be used in preference to this legacy method.
java.math.BigDecimal.setScale(int, int)
9
The method `BigDecimal.setScale(int, RoundingMode)` should be used in preference to this legacy method.
java.net.DatagramSocket.setDatagramSocketImplFactory(DatagramSocketImplFactory)
17
Use `DatagramChannel`, or subclass `DatagramSocket` directly.
This method provided a way in early JDK releases to replace the system wide implementation of `DatagramSocket`. It has been mostly obsolete since Java 1.4. If required, a `DatagramSocket` can be created to use a custom implementation by extending `DatagramSocket` and using the protected constructor that takes an implementation as a parameter.
java.net.DatagramSocketImpl.getTTL()
1.2
use getTimeToLive instead.
java.net.DatagramSocketImpl.setTTL(byte)
1.2
use setTimeToLive instead.
java.net.HttpURLConnection.getPermission()
25
Permissions can no longer be used for controlling access to resources as the Security Manager is no longer supported.
java.net.MulticastSocket.getInterface()
14
The network interface may not be uniquely identified by the InetAddress returned. Use `MulticastSocket.getNetworkInterface()` instead.
java.net.MulticastSocket.getLoopbackMode()
14
Use `DatagramSocket.getOption(SocketOption)` with `StandardSocketOptions.IP_MULTICAST_LOOP` instead.
java.net.MulticastSocket.getTTL()
1.2
use the `MulticastSocket.getTimeToLive()` method instead, which returns an int instead of a byte.
java.net.MulticastSocket.joinGroup(InetAddress)
14
This method does not accept the network interface on which to join the multicast group. Use `MulticastSocket.joinGroup(SocketAddress, NetworkInterface)` instead.
java.net.MulticastSocket.leaveGroup(InetAddress)
14
This method does not accept the network interface on which to leave the multicast group. Use `MulticastSocket.leaveGroup(SocketAddress, NetworkInterface)` instead.
java.net.MulticastSocket.send(DatagramPacket, byte)
1.4
Use the following code or its equivalent instead:

      ......
     int ttl = mcastSocket.getOption(StandardSocketOptions.IP_MULTICAST_TTL);
     mcastSocket.setOption(StandardSocketOptions.IP_MULTICAST_TTL, newttl);
     mcastSocket.send(p);
     mcastSocket.setOption(StandardSocketOptions.IP_MULTICAST_TTL, ttl);
     ......

java.net.MulticastSocket.setInterface(InetAddress)
14
The InetAddress may not uniquely identify the network interface. Use `MulticastSocket.setNetworkInterface(NetworkInterface)` instead.
java.net.MulticastSocket.setLoopbackMode(boolean)
14
Use `DatagramSocket.setOption(SocketOption, Object)` with `StandardSocketOptions.IP_MULTICAST_LOOP` instead. The loopback mode is enabled by default, `MulticastSocket.setOption(StandardSocketOptions.IP_MULTICAST_LOOP, false)` disables it.
java.net.MulticastSocket.setTTL(byte)
1.2
use the `MulticastSocket.setTimeToLive(int)` method instead, which uses int instead of byte as the type for ttl.
java.net.ServerSocket.setSocketFactory(SocketImplFactory)
17
Use a `ServerSocketFactory` and subclass `ServerSocket` directly.
This method provided a way in early JDK releases to replace the system wide implementation of `ServerSocket`. It has been mostly obsolete since Java 1.4. If required, a `ServerSocket` can be created to use a custom implementation by extending `ServerSocket` and using the protected constructor that takes an implementation as a parameter.
java.net.Socket.setSocketImplFactory(SocketImplFactory)
17
Use a `SocketFactory` and subclass `Socket` directly.
This method provided a way in early JDK releases to replace the system wide implementation of `Socket`. It has been mostly obsolete since Java 1.4. If required, a `Socket` can be created to use a custom implementation by extending `Socket` and using the protected constructor that takes an implementation as a parameter.
java.net.URLConnection.getDefaultRequestProperty(String)
The instance specific getRequestProperty method should be used after an appropriate instance of URLConnection is obtained.
java.net.URLConnection.getPermission()
25
Permissions can no longer be used for controlling access to resources as the Security Manager is no longer supported.
java.net.URLConnection.setDefaultRequestProperty(String, String)
The instance specific setRequestProperty method should be used after an appropriate instance of URLConnection is obtained. Invoking this method will have no effect.
java.net.URLDecoder.decode(String)
The resulting string may vary depending on the default charset. Instead, use the decode(String,String) method to specify the encoding.
java.net.URLEncoder.encode(String)
The resulting string may vary depending on the default charset. Instead, use the encode(String,String) method to specify the encoding.
java.net.URLStreamHandler.setURL(URL, String, String, int, String, String)
Use setURL(URL, String, String, int, String, String, String, String);
java.rmi.dgc.VMID.isUnique()
java.rmi.registry.RegistryHandler.registryImpl(int)
no replacement. As of the Java 2 platform v1.2, RMI no longer uses the `RegistryHandler` to obtain the registry's implementation.
java.rmi.registry.RegistryHandler.registryStub(String, int)
no replacement. As of the Java 2 platform v1.2, RMI no longer uses the `RegistryHandler` to obtain the registry's stub.
java.rmi.server.LoaderHandler.getSecurityContext(ClassLoader)
no replacement
java.rmi.server.LoaderHandler.loadClass(String)
no replacement
java.rmi.server.LoaderHandler.loadClass(URL, String)
no replacement
java.rmi.server.LogStream.getDefaultStream()
no replacement
java.rmi.server.LogStream.getOutputStream()
no replacement
java.rmi.server.LogStream.log(String)
no replacement
java.rmi.server.LogStream.parseLevel(String)
no replacement
java.rmi.server.LogStream.setDefaultStream(PrintStream)
no replacement
java.rmi.server.LogStream.setOutputStream(OutputStream)
no replacement
java.rmi.server.LogStream.toString()
no replacement
java.rmi.server.LogStream.write(byte[], int, int)
no replacement
java.rmi.server.LogStream.write(int)
no replacement
java.rmi.server.Operation.getOperation()
no replacement
java.rmi.server.Operation.toString()
no replacement
java.rmi.server.RemoteCall.done()
no replacement
java.rmi.server.RemoteCall.executeCall()
no replacement
java.rmi.server.RemoteCall.getInputStream()
no replacement
java.rmi.server.RemoteCall.getOutputStream()
no replacement
java.rmi.server.RemoteCall.getResultStream(boolean)
no replacement
java.rmi.server.RemoteCall.releaseInputStream()
no replacement
java.rmi.server.RemoteCall.releaseOutputStream()
no replacement
java.rmi.server.RemoteRef.done(RemoteCall)
1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (`newCall`, `invoke`, and `done`), a stub uses a single method, `invoke(Remote, Method, Object[], int)`, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.
java.rmi.server.RemoteRef.invoke(RemoteCall)
1.2 style stubs no longer use this method. Instead of using a sequence of method calls to the remote reference (`newCall`, `invoke`, and `done`), a stub uses a single method, `invoke(Remote, Method, Object[], int)`, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.
java.rmi.server.RemoteRef.newCall(RemoteObject, Operation[], int, long)
1.2 style stubs no longer use this method. Instead of using a sequence of method calls on the stub's the remote reference (`newCall`, `invoke`, and `done`), a stub uses a single method, `invoke(Remote, Method, Object[], int)`, on the remote reference to carry out parameter marshalling, remote method executing and unmarshalling of the return value.
java.rmi.server.RemoteStub.setRef(RemoteStub, RemoteRef)
No replacement. The `setRef` method was intended for setting the remote reference of a remote stub. This is unnecessary, since `RemoteStub`s can be created and initialized with a remote reference through use of the `RemoteStub(RemoteRef)` constructor.
java.rmi.server.RMIClassLoader.getSecurityContext(ClassLoader)
no replacement. This method has no purpose in the absence of a Security Manager.
java.rmi.server.RMIClassLoader.loadClass(String)
replaced by `loadClass(String,String)` method
java.rmi.server.Skeleton.dispatch(Remote, RemoteCall, int, long)
no replacement
java.rmi.server.Skeleton.getOperations()
no replacement
java.rmi.server.UnicastRemoteObject.exportObject(Remote)
This method is deprecated because it supports only static stubs. Use `exportObject(Remote, port)` or `exportObject(Remote, port, csf, ssf)` instead.
java.security.cert.X509Certificate.getIssuerDN()
16
Use `X509Certificate.getIssuerX500Principal()` instead. This method returns the `issuer` as an implementation specific `Principal` object, which should not be relied upon by portable code.
java.security.cert.X509Certificate.getSubjectDN()
16
Use `X509Certificate.getSubjectX500Principal()` instead. This method returns the `subject` as an implementation specific `Principal` object, which should not be relied upon by portable code.
java.security.cert.X509CertSelector.getIssuerAsString()
16
Use `X509CertSelector.getIssuer()` or `X509CertSelector.getIssuerAsBytes()` instead. This method should not be relied on as it can fail to match some certificates because of a loss of encoding information in the RFC 2253 String form of some distinguished names.
java.security.cert.X509CertSelector.getSubjectAsString()
16
Use `X509CertSelector.getSubject()` or `X509CertSelector.getSubjectAsBytes()` instead. This method should not be relied on as it can fail to match some certificates because of a loss of encoding information in the RFC 2253 String form of some distinguished names.
java.security.cert.X509CertSelector.setIssuer(String)
16
Use `X509CertSelector.setIssuer(X500Principal)` or `X509CertSelector.setIssuer(byte[])` instead. This method should not be relied on as it can fail to match some certificates because of a loss of encoding information in the RFC 2253 String form of some distinguished names.
java.security.cert.X509CertSelector.setSubject(String)
16
Use `X509CertSelector.setSubject(X500Principal)` or `X509CertSelector.setSubject(byte[])` instead. This method should not be relied on as it can fail to match some certificates because of a loss of encoding information in the RFC 2253 String form of some distinguished names.
java.security.cert.X509CRL.getIssuerDN()
16
Use `X509CRL.getIssuerX500Principal()` instead. This method returns the `issuer` as an implementation specific `Principal` object, which should not be relied upon by portable code.
java.security.cert.X509CRLSelector.addIssuerName(String)
16
Use `X509CRLSelector.addIssuer(X500Principal)` or `X509CRLSelector.addIssuerName(byte[])` instead. This method should not be relied on as it can fail to match some CRLs because of a loss of encoding information in the RFC 2253 String form of some distinguished names.
java.security.Provider.getVersion()
9
use `Provider.getVersionStr()` instead.
java.security.Security.getAlgorithmProperty(String, String)
This method used to return the value of a proprietary property in the master file of the "SUN" Cryptographic Service Provider in order to determine how to parse algorithm-specific parameters. Use the new provider-based and algorithm-independent `AlgorithmParameters` and `KeyFactory` engine classes (introduced in the J2SE version 1.2 platform) instead.
java.security.Signature.getParameter(String)
java.security.Signature.setParameter(String, Object)
Use `setParameter`.
java.security.SignatureSpi.engineGetParameter(String)
java.security.SignatureSpi.engineSetParameter(String, Object)
Replaced by `engineSetParameter`.
java.sql.CallableStatement.getBigDecimal(int, int)
1.2
use `getBigDecimal(int parameterIndex)` or `getBigDecimal(String parameterName)`
java.sql.Date.getHours()
1.2
java.sql.Date.getMinutes()
1.2
java.sql.Date.getSeconds()
1.2
java.sql.Date.setHours(int)
1.2
java.sql.Date.setMinutes(int)
1.2
java.sql.Date.setSeconds(int)
1.2
java.sql.DriverManager.getLogStream()
1.2
Use `getLogWriter`
java.sql.DriverManager.setLogStream(PrintStream)
1.2
Use `setLogWriter`
java.sql.PreparedStatement.setUnicodeStream(int, InputStream, int)
1.2
Use `setCharacterStream`
java.sql.ResultSet.getBigDecimal(int, int)
1.2
Use `getBigDecimal(int columnIndex)` or `getBigDecimal(String columnLabel)`
java.sql.ResultSet.getBigDecimal(String, int)
1.2
Use `getBigDecimal(int columnIndex)` or `getBigDecimal(String columnLabel)`
java.sql.ResultSet.getUnicodeStream(int)
1.2
use `getCharacterStream` in place of `getUnicodeStream`
java.sql.ResultSet.getUnicodeStream(String)
1.2
use `getCharacterStream` instead
java.sql.Time.getDate()
1.2
java.sql.Time.getDay()
1.2
java.sql.Time.getMonth()
1.2
java.sql.Time.getYear()
1.2
java.sql.Time.setDate(int)
1.2
java.sql.Time.setMonth(int)
1.2
java.sql.Time.setYear(int)
1.2
java.util.concurrent.atomic.AtomicBoolean.weakCompareAndSet(boolean, boolean)
9
This method has plain memory effects but the method name implies volatile memory effects (see methods such as `AtomicBoolean.compareAndExchange(boolean, boolean)` and `AtomicBoolean.compareAndSet(boolean, boolean)`). To avoid confusion over plain or volatile memory effects it is recommended that the method `AtomicBoolean.weakCompareAndSetPlain(boolean, boolean)` be used instead.
java.util.concurrent.atomic.AtomicInteger.weakCompareAndSet(int, int)
9
This method has plain memory effects but the method name implies volatile memory effects (see methods such as `AtomicInteger.compareAndExchange(int, int)` and `AtomicInteger.compareAndSet(int, int)`). To avoid confusion over plain or volatile memory effects it is recommended that the method `AtomicInteger.weakCompareAndSetPlain(int, int)` be used instead.
java.util.concurrent.atomic.AtomicIntegerArray.weakCompareAndSet(int, int, int)
9
This method has plain memory effects but the method name implies volatile memory effects (see methods such as `AtomicIntegerArray.compareAndExchange(int, int, int)` and `AtomicIntegerArray.compareAndSet(int, int, int)`). To avoid confusion over plain or volatile memory effects it is recommended that the method `AtomicIntegerArray.weakCompareAndSetPlain(int, int, int)` be used instead.
java.util.concurrent.atomic.AtomicLong.weakCompareAndSet(long, long)
9
This method has plain memory effects but the method name implies volatile memory effects (see methods such as `AtomicLong.compareAndExchange(long, long)` and `AtomicLong.compareAndSet(long, long)`). To avoid confusion over plain or volatile memory effects it is recommended that the method `AtomicLong.weakCompareAndSetPlain(long, long)` be used instead.
java.util.concurrent.atomic.AtomicLongArray.weakCompareAndSet(int, long, long)
9
This method has plain memory effects but the method name implies volatile memory effects (see methods such as `AtomicLongArray.compareAndExchange(int, long, long)` and `AtomicLongArray.compareAndSet(int, long, long)`). To avoid confusion over plain or volatile memory effects it is recommended that the method `AtomicLongArray.weakCompareAndSetPlain(int, long, long)` be used instead.
java.util.concurrent.atomic.AtomicReference.weakCompareAndSet(V, V)
9
This method has plain memory effects but the method name implies volatile memory effects (see methods such as `AtomicReference.compareAndExchange(V, V)` and `AtomicReference.compareAndSet(V, V)`). To avoid confusion over plain or volatile memory effects it is recommended that the method `AtomicReference.weakCompareAndSetPlain(V, V)` be used instead.
java.util.concurrent.atomic.AtomicReferenceArray.weakCompareAndSet(int, E, E)
9
This method has plain memory effects but the method name implies volatile memory effects (see methods such as `AtomicReferenceArray.compareAndExchange(int, E, E)` and `AtomicReferenceArray.compareAndSet(int, E, E)`). To avoid confusion over plain or volatile memory effects it is recommended that the method `AtomicReferenceArray.weakCompareAndSetPlain(int, E, E)` be used instead.
java.util.concurrent.Executors.privilegedCallable(Callable<T>)
17
This method originally returned a `Callable` object that when called, executed the given `callable` under the current access control context. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.concurrent.Executors.privilegedCallableUsingCurrentClassLoader(Callable<T>)
17
This method originally returned a `Callable` object that when called, executed the given `callable` under the current access control context, with the current context class loader as the context class loader. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.concurrent.Executors.privilegedThreadFactory()
17
This method originally returned a thread factory that created new threads that had the same access control context as the current thread. Access control contexts were only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.concurrent.ThreadPoolExecutor.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
java.util.Date.getDate()
As of JDK version 1.1, replaced by `Calendar.get(Calendar.DAY_OF_MONTH)`.
java.util.Date.getDay()
As of JDK version 1.1, replaced by `Calendar.get(Calendar.DAY_OF_WEEK)`.
java.util.Date.getHours()
As of JDK version 1.1, replaced by `Calendar.get(Calendar.HOUR_OF_DAY)`.
java.util.Date.getMinutes()
As of JDK version 1.1, replaced by `Calendar.get(Calendar.MINUTE)`.
java.util.Date.getMonth()
As of JDK version 1.1, replaced by `Calendar.get(Calendar.MONTH)`.
java.util.Date.getSeconds()
As of JDK version 1.1, replaced by `Calendar.get(Calendar.SECOND)`.
java.util.Date.getTimezoneOffset()
As of JDK version 1.1, replaced by `-(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000)`.
java.util.Date.getYear()
As of JDK version 1.1, replaced by `Calendar.get(Calendar.YEAR) - 1900`.
java.util.Date.parse(String)
As of JDK version 1.1, replaced by `DateFormat.parse(String s)`.
java.util.Date.setDate(int)
As of JDK version 1.1, replaced by `Calendar.set(Calendar.DAY_OF_MONTH, int date)`.
java.util.Date.setHours(int)
As of JDK version 1.1, replaced by `Calendar.set(Calendar.HOUR_OF_DAY, int hours)`.
java.util.Date.setMinutes(int)
As of JDK version 1.1, replaced by `Calendar.set(Calendar.MINUTE, int minutes)`.
java.util.Date.setMonth(int)
As of JDK version 1.1, replaced by `Calendar.set(Calendar.MONTH, int month)`.
java.util.Date.setSeconds(int)
As of JDK version 1.1, replaced by `Calendar.set(Calendar.SECOND, int seconds)`.
java.util.Date.setYear(int)
As of JDK version 1.1, replaced by `Calendar.set(Calendar.YEAR, year + 1900)`.
java.util.Date.toGMTString()
As of JDK version 1.1, replaced by `DateFormat.format(Date date)`, using a GMT `TimeZone`.
java.util.Date.toLocaleString()
As of JDK version 1.1, replaced by `DateFormat.format(Date date)`.
java.util.Date.UTC(int, int, int, int, int, int)
As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date, hrs, min, sec)` or `GregorianCalendar(year + 1900, month, date, hrs, min, sec)`, using a UTC `TimeZone`, followed by `Calendar.getTime().getTime()`.
java.util.logging.Logger.logrb(Level, String, String, String, String)
Use `Logger.logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.util.ResourceBundle, java.lang.String, java.lang.Object...)` instead.
java.util.logging.Logger.logrb(Level, String, String, String, String, Object)
Use `Logger.logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.util.ResourceBundle, java.lang.String, java.lang.Object...)` instead
java.util.logging.Logger.logrb(Level, String, String, String, String, Object[])
Use `Logger.logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.util.ResourceBundle, java.lang.String, java.lang.Object...)` instead.
java.util.logging.Logger.logrb(Level, String, String, String, String, Throwable)
Use `Logger.logrb(java.util.logging.Level, java.lang.String, java.lang.String, java.util.ResourceBundle, java.lang.String, java.lang.Throwable)` instead.
java.util.logging.LogManager.checkAccess()
17
This method originally checked that the current context was trusted to modify the logging configuration. This method was only useful in conjunction with the Security Manager, which is no longer supported. There is no replacement for the Security Manager or this method.
java.util.logging.LogManager.getLoggingMXBean()
9
`java.util.logging.LoggingMXBean` is deprecated and replaced with `java.lang.management.PlatformLoggingMXBean`. Use `ManagementFactory.getPlatformMXBean`(PlatformLoggingMXBean.class) instead.
java.util.logging.LogRecord.getThreadID()
16
Values returned by this method may be synthesized, and may not correspond to the actual thread id, use `LogRecord.getLongThreadID()` instead.
java.util.logging.LogRecord.setMillis(long)
LogRecord maintains timestamps with nanosecond resolution, using `Instant` values. For this reason, `setInstant()` should be used in preference to `setMillis()`.
java.util.logging.LogRecord.setThreadID(int)
16
This method doesn't allow to pass a long thread id, use `LogRecord.setLongThreadID(long)` instead.
java.util.Properties.save(OutputStream, String)
This method does not throw an IOException if an I/O error occurs while saving the property list. The preferred way to save a properties list is via the `store(OutputStream out, String comments)` method or the `storeToXML(OutputStream os, String comment)` method.
java.util.zip.Deflater.getTotalIn()
23
Use `Deflater.getBytesRead()` instead
java.util.zip.Deflater.getTotalOut()
23
Use `Deflater.getBytesWritten()` instead
java.util.zip.Inflater.getTotalIn()
23
Use `Inflater.getBytesRead()` instead
java.util.zip.Inflater.getTotalOut()
23
Use `Inflater.getBytesWritten()` instead
javax.imageio.spi.ServiceRegistry.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.FileCacheImageInputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.FileImageInputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.FileImageOutputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.ImageInputStreamImpl.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.imageio.stream.MemoryCacheImageInputStream.finalize()
9
Finalization has been deprecated for removal. See `Object.finalize()` for background information and details about migration options.
javax.management.AttributeValueExp.setMBeanServer(MBeanServer)
This method has no effect. The MBean Server used to obtain an attribute value is `QueryEval.getMBeanServer()`.
javax.management.MBeanServer.deserialize(String, byte[])
1.5
Use `MBeanServer.getClassLoaderRepository()` to obtain the class loader repository and use it to deserialize.
javax.management.MBeanServer.deserialize(String, ObjectName, byte[])
1.5
Use `getClassLoader` to obtain the class loader for deserialization.
javax.management.MBeanServer.deserialize(ObjectName, byte[])
1.5
Use `getClassLoaderFor` to obtain the appropriate class loader for deserialization.
javax.management.modelmbean.DescriptorSupport.toXMLString()
25
This method exists for historical reasons. If writing to XML is required, it should be implemented externally.
javax.management.monitor.CounterMonitor.getDerivedGauge()
As of JMX 1.2, replaced by `CounterMonitor.getDerivedGauge(ObjectName)`
javax.management.monitor.CounterMonitor.getDerivedGaugeTimeStamp()
As of JMX 1.2, replaced by `CounterMonitor.getDerivedGaugeTimeStamp(ObjectName)`
javax.management.monitor.CounterMonitor.getThreshold()
As of JMX 1.2, replaced by `CounterMonitor.getThreshold(ObjectName)`
javax.management.monitor.CounterMonitor.setThreshold(Number)
As of JMX 1.2, replaced by `CounterMonitor.setInitThreshold(Number)`
javax.management.monitor.CounterMonitorMBean.getDerivedGauge()
As of JMX 1.2, replaced by `CounterMonitorMBean.getDerivedGauge(ObjectName)`
javax.management.monitor.CounterMonitorMBean.getDerivedGaugeTimeStamp()
As of JMX 1.2, replaced by `CounterMonitorMBean.getDerivedGaugeTimeStamp(ObjectName)`
javax.management.monitor.CounterMonitorMBean.getThreshold()
As of JMX 1.2, replaced by `CounterMonitorMBean.getThreshold(ObjectName)`
javax.management.monitor.CounterMonitorMBean.setThreshold(Number)
As of JMX 1.2, replaced by `CounterMonitorMBean.setInitThreshold(Number)`
javax.management.monitor.GaugeMonitor.getDerivedGauge()
As of JMX 1.2, replaced by `GaugeMonitor.getDerivedGauge(ObjectName)`
javax.management.monitor.GaugeMonitor.getDerivedGaugeTimeStamp()
As of JMX 1.2, replaced by `GaugeMonitor.getDerivedGaugeTimeStamp(ObjectName)`
javax.management.monitor.GaugeMonitorMBean.getDerivedGauge()
As of JMX 1.2, replaced by `GaugeMonitorMBean.getDerivedGauge(ObjectName)`
javax.management.monitor.GaugeMonitorMBean.getDerivedGaugeTimeStamp()
As of JMX 1.2, replaced by `GaugeMonitorMBean.getDerivedGaugeTimeStamp(ObjectName)`
javax.management.monitor.Monitor.getObservedObject()
As of JMX 1.2, replaced by `Monitor.getObservedObjects()`
javax.management.monitor.Monitor.setObservedObject(ObjectName)
As of JMX 1.2, replaced by `Monitor.addObservedObject(ObjectName)`
javax.management.monitor.MonitorMBean.getObservedObject()
As of JMX 1.2, replaced by `MonitorMBean.getObservedObjects()`
javax.management.monitor.MonitorMBean.setObservedObject(ObjectName)
As of JMX 1.2, replaced by `MonitorMBean.addObservedObject(ObjectName)`
javax.management.monitor.StringMonitor.getDerivedGauge()
As of JMX 1.2, replaced by `StringMonitor.getDerivedGauge(ObjectName)`
javax.management.monitor.StringMonitor.getDerivedGaugeTimeStamp()
As of JMX 1.2, replaced by `StringMonitor.getDerivedGaugeTimeStamp(ObjectName)`
javax.management.monitor.StringMonitorMBean.getDerivedGauge()
As of JMX 1.2, replaced by `StringMonitorMBean.getDerivedGauge(ObjectName)`
javax.management.monitor.StringMonitorMBean.getDerivedGaugeTimeStamp()
As of JMX 1.2, replaced by `StringMonitorMBean.getDerivedGaugeTimeStamp(ObjectName)`
javax.management.remote.JMXConnector.getMBeanServerConnection(Subject)
21
This method supported the legacy Subject Delegation feature, which has been removed. There is no replacement.
javax.management.StringValueExp.setMBeanServer(MBeanServer)
javax.management.ValueExp.setMBeanServer(MBeanServer)
This method is not needed because a `ValueExp` can access the MBean server in which it is being evaluated by using `QueryEval.getMBeanServer()`.
javax.net.ssl.HandshakeCompletedEvent.getPeerCertificateChain()
9
The `HandshakeCompletedEvent.getPeerCertificates()` method that returns an array of `java.security.cert.Certificate` should be used instead.
javax.net.ssl.SSLSession.getPeerCertificateChain()
9
The `SSLSession.getPeerCertificates()` method that returns an array of `java.security.cert.Certificate` should be used instead.
javax.security.auth.Subject.doAs(Subject, PrivilegedAction<T>)
18
This method originally performed the specified `PrivilegedAction` with privileges enabled. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.doAs(Subject, PrivilegedExceptionAction<T>)
18
This method originally performed the specified `PrivilegedExceptionAction` with privileges enabled. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.doAsPrivileged(Subject, PrivilegedAction<T>, AccessControlContext)
17
This method originally performed the specified `PrivilegedAction` with privileges enabled and restricted by the specified `AccessControlContext`. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to ignore the `AccessControlContext` and launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.doAsPrivileged(Subject, PrivilegedExceptionAction<T>, AccessControlContext)
17
This method originally performed the specified `PrivilegedExceptionAction` with privileges enabled and restricted by the specified `AccessControlContext`. Running the action with privileges enabled was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to ignore the `AccessControlContext` and launch the action as is and bind the subject to the period of its execution. A replacement API named `Subject.callAs(Subject, Callable)` has been added which can be used to perform the same work. There is no replacement for the Security Manager.
javax.security.auth.Subject.getSubject(AccessControlContext)
17
This method used to get the subject associated with the provided `AccessControlContext`, which was only useful in conjunction with the Security Manager, which is no longer supported. This method has been changed to always throw `UnsupportedOperationException`. A replacement API named `Subject.current()` has been added which can be used to obtain the current subject. There is no replacement for the Security Manager.
javax.sql.rowset.BaseRowSet.setUnicodeStream(int, InputStream, int)
getCharacterStream should be used in its place
javax.swing.AbstractButton.getLabel()
- Replaced by `getText`
javax.swing.AbstractButton.setLabel(String)
- Replaced by `setText(text)`
javax.swing.FocusManager.disableSwingFocusManager()
as of 1.4, replaced by `KeyboardFocusManager.setDefaultFocusTraversalPolicy(FocusTraversalPolicy)`
javax.swing.FocusManager.isFocusManagerEnabled()
As of 1.4, replaced by `KeyboardFocusManager.getDefaultFocusTraversalPolicy()`
javax.swing.InputVerifier.shouldYieldFocus(JComponent)
9
use `InputVerifier.shouldYieldFocus(JComponent, JComponent)` instead.
javax.swing.JComponent.disable()
As of JDK version 1.1, replaced by `java.awt.Component.setEnabled(boolean)`.
javax.swing.JComponent.enable()
As of JDK version 1.1, replaced by `java.awt.Component.setEnabled(boolean)`.
javax.swing.JComponent.getNextFocusableComponent()
As of 1.4, replaced by `FocusTraversalPolicy`.
javax.swing.JComponent.hide()
javax.swing.JComponent.isManagingFocus()
As of 1.4, replaced by `Component.setFocusTraversalKeys(int, Set)` and `Container.setFocusCycleRoot(boolean)`.
javax.swing.JComponent.requestDefaultFocus()
As of 1.4, replaced by `FocusTraversalPolicy.getDefaultComponent(Container).requestFocus()`
javax.swing.JComponent.reshape(int, int, int, int)
As of JDK 5, replaced by `Component.setBounds(int, int, int, int)`.

Moves and resizes this component.

javax.swing.JComponent.setNextFocusableComponent(Component)
As of 1.4, replaced by `FocusTraversalPolicy`
javax.swing.JInternalFrame.getMenuBar()
As of Swing version 1.0.3, replaced by `getJMenuBar()`.
javax.swing.JInternalFrame.getWarningString()
24
since JDK 24
javax.swing.JInternalFrame.setMenuBar(JMenuBar)
As of Swing version 1.0.3 replaced by `setJMenuBar(JMenuBar m)`.
javax.swing.JList.getSelectedValues()
As of JDK 1.7, replaced by `JList.getSelectedValuesList()`
javax.swing.JMenuBar.getComponentAtIndex(int)
replaced by `getComponent(int i)`
javax.swing.JPasswordField.getText()
As of Java 2 platform v1.2, replaced by `getPassword`.
javax.swing.JPasswordField.getText(int, int)
As of Java 2 platform v1.2, replaced by `getPassword`.
javax.swing.JPopupMenu.getComponentAtIndex(int)
replaced by `Container.getComponent(int)`
javax.swing.JRootPane.getMenuBar()
As of Swing version 1.0.3 replaced by `getJMenuBar()`.
javax.swing.JRootPane.setMenuBar(JMenuBar)
As of Swing version 1.0.3 replaced by `setJMenuBar(JMenuBar menu)`.
javax.swing.JTable.createScrollPaneForTable(JTable)
As of Swing version 1.0.2, replaced by `new JScrollPane(aTable)`.
javax.swing.JTable.sizeColumnsToFit(boolean)
As of Swing version 1.0.3, replaced by `doLayout()`.
javax.swing.JViewport.isBackingStoreEnabled()
As of Java 2 platform v1.3, replaced by `getScrollMode()`.
javax.swing.JViewport.setBackingStoreEnabled(boolean)
As of Java 2 platform v1.3, replaced by `setScrollMode()`.
javax.swing.KeyStroke.getKeyStroke(char, boolean)
use getKeyStroke(char)
javax.swing.plaf.basic.BasicDirectoryModel.intervalAdded(ListDataEvent)
17
Obsolete method, not used anymore.
javax.swing.plaf.basic.BasicDirectoryModel.intervalRemoved(ListDataEvent)
17
Obsolete method, not used anymore.
javax.swing.plaf.basic.BasicDirectoryModel.lt(File, File)
17
Obsolete method, not used anymore.
javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardDownRightListener()
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardEndListener()
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardHomeListener()
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardResizeToggleListener()
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.createKeyboardUpLeftListener()
As of Java 2 platform v1.3.
javax.swing.plaf.basic.BasicSplitPaneUI.getDividerBorderSize()
As of Java 2 platform v1.3, instead set the border on the divider.
javax.swing.plaf.basic.BasicTextUI.modelToView(JTextComponent, int)
9
replaced by `TextUI.modelToView2D(JTextComponent, int, Position.Bias)`
javax.swing.plaf.basic.BasicTextUI.modelToView(JTextComponent, int, Position.Bias)
9
replaced by `TextUI.modelToView2D(JTextComponent, int, Position.Bias)`
javax.swing.plaf.basic.BasicTextUI.viewToModel(JTextComponent, Point)
9
replaced by `TextUI.viewToModel2D(JTextComponent, Point2D, Position.Bias[])`
javax.swing.plaf.basic.BasicTextUI.viewToModel(JTextComponent, Point, Position.Bias[])
9
replaced by `TextUI.viewToModel2D(JTextComponent, Point2D, Position.Bias[])`
javax.swing.plaf.basic.BasicToolBarUI.createFloatingFrame(JToolBar)
17
It is recommended that `BasicToolBarUI.createFloatingWindow(JToolBar)` be used instead
javax.swing.plaf.metal.MetalComboBoxUI.editablePropertyChanged(PropertyChangeEvent)
As of Java 2 platform v1.4.
javax.swing.plaf.metal.MetalComboBoxUI.removeListeners()
As of Java 2 platform v1.4.
javax.swing.plaf.metal.MetalScrollPaneUI.uninstallListeners(JScrollPane)
- Replaced by `BasicScrollPaneUI.uninstallListeners(JComponent)`
javax.swing.plaf.multi.MultiTextUI.modelToView(JTextComponent, int)
9
replaced by `TextUI.modelToView2D(JTextComponent, int, Position.Bias)`
javax.swing.plaf.multi.MultiTextUI.modelToView(JTextComponent, int, Position.Bias)
9
replaced by `TextUI.modelToView2D(JTextComponent, int, Position.Bias)`
javax.swing.plaf.multi.MultiTextUI.viewToModel(JTextComponent, Point)
9
javax.swing.plaf.multi.MultiTextUI.viewToModel(JTextComponent, Point, Position.Bias[])
9
javax.swing.plaf.TextUI.getToolTipText(JTextComponent, Point)
9
replaced by `TextUI.getToolTipText2D(JTextComponent, Point2D)`
javax.swing.plaf.TextUI.modelToView(JTextComponent, int)
9
replaced by `TextUI.modelToView2D(JTextComponent, int, Position.Bias)`
javax.swing.plaf.TextUI.modelToView(JTextComponent, int, Position.Bias)
9
replaced by `TextUI.modelToView2D(JTextComponent, int, Position.Bias)`
javax.swing.plaf.TextUI.viewToModel(JTextComponent, Point)
9
replaced by `TextUI.viewToModel2D(JTextComponent, Point2D, Position.Bias[])`
javax.swing.plaf.TextUI.viewToModel(JTextComponent, Point, Position.Bias[])
9
replaced by `TextUI.viewToModel2D(JTextComponent, Point2D, Position.Bias[])`
javax.swing.RepaintManager.addDirtyRegion(Applet, int, int, int, int)
9
The Applet API is deprecated. See the java.applet package documentation for further information.
javax.swing.ScrollPaneLayout.getViewportBorderBounds(JScrollPane)
As of JDK version Swing1.1 replaced by `JScrollPane.getViewportBorderBounds()`.
javax.swing.SwingUtilities.findFocusOwner(Component)
As of 1.4, replaced by `KeyboardFocusManager.getFocusOwner()`.
javax.swing.table.TableColumn.disableResizedPosting()
as of Java 2 platform v1.3
javax.swing.table.TableColumn.enableResizedPosting()
as of Java 2 platform v1.3
javax.swing.text.html.HTMLEditorKit.InsertHTMLTextAction.insertAtBoundry(JEditorPane, HTMLDocument, int, Element, String, HTML.Tag, HTML.Tag)
As of Java 2 platform v1.3, use insertAtBoundary
javax.swing.text.JTextComponent.modelToView(int)
9
replaced by `JTextComponent.modelToView2D(int)`
javax.swing.text.JTextComponent.viewToModel(Point)
9
replaced by `JTextComponent.viewToModel2D(Point2D)`
javax.swing.text.LabelView.getFontMetrics()
FontMetrics are not used for glyph rendering when running in the JDK.
javax.swing.text.PasswordView.drawEchoCharacter(Graphics, int, int, char)
9
replaced by `PasswordView.drawEchoCharacter(Graphics2D, float, float, char)`
javax.swing.text.PasswordView.drawSelectedText(Graphics, int, int, int, int)
9
replaced by `PlainView.drawSelectedText(Graphics2D, float, float, int, int)`
javax.swing.text.PasswordView.drawUnselectedText(Graphics, int, int, int, int)
9
replaced by `PlainView.drawUnselectedText(Graphics2D, float, float, int, int)`
javax.swing.text.PlainView.drawLine(int, Graphics, int, int)
9
replaced by `PlainView.drawLine(int, Graphics2D, float, float)`
javax.swing.text.PlainView.drawSelectedText(Graphics, int, int, int, int)
9
replaced by `PlainView.drawSelectedText(Graphics2D, float, float, int, int)`
javax.swing.text.PlainView.drawUnselectedText(Graphics, int, int, int, int)
9
replaced by `PlainView.drawUnselectedText(Graphics2D, float, float, int, int)`
javax.swing.text.TableView.createTableCell(Element)
Table cells can now be any arbitrary View implementation and should be produced by the ViewFactory rather than the table.
javax.swing.text.Utilities.drawTabbedText(Segment, int, int, Graphics, TabExpander, int)
9
replaced by `Utilities.drawTabbedText(Segment, float, float, Graphics2D, TabExpander, int)`
javax.swing.text.Utilities.getBreakLocation(Segment, FontMetrics, int, int, TabExpander, int)
9
replaced by `Utilities.getBreakLocation(Segment, FontMetrics, float, float, TabExpander, int)`
javax.swing.text.Utilities.getPositionAbove(JTextComponent, int, int)
9
replaced by `Utilities.getPositionAbove(JTextComponent, int, float)`
javax.swing.text.Utilities.getPositionBelow(JTextComponent, int, int)
9
replaced by `Utilities.getPositionBelow(JTextComponent, int, float)`
javax.swing.text.Utilities.getTabbedTextOffset(Segment, FontMetrics, int, int, TabExpander, int)
9
replaced by `Utilities.getTabbedTextOffset(Segment, FontMetrics, float, float, TabExpander, int, boolean)`
javax.swing.text.Utilities.getTabbedTextOffset(Segment, FontMetrics, int, int, TabExpander, int, boolean)
9
replaced by `Utilities.getTabbedTextOffset(Segment, FontMetrics, float, float, TabExpander, int, boolean)`
javax.swing.text.Utilities.getTabbedTextWidth(Segment, FontMetrics, int, TabExpander, int)
9
replaced by `Utilities.getTabbedTextWidth(Segment, FontMetrics, float, TabExpander, int)`
javax.swing.text.View.modelToView(int, Shape)
javax.swing.text.View.viewToModel(float, float, Shape)
javax.swing.text.WrappedPlainView.drawLine(int, int, Graphics, int, int)
9
replaced by `WrappedPlainView.drawLine(int, int, Graphics2D, float, float)`
javax.swing.text.WrappedPlainView.drawSelectedText(Graphics, int, int, int, int)
9
replaced by `WrappedPlainView.drawSelectedText(Graphics2D, float, float, int, int)`
javax.swing.text.WrappedPlainView.drawUnselectedText(Graphics, int, int, int, int)
9
replaced by `WrappedPlainView.drawUnselectedText(Graphics2D, float, float, int, int)`
javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Vector<?>, TreePath)
As of JDK version 1.7
javax.tools.StandardJavaFileManager.getJavaFileObjectsFromPaths(Iterable<? extends Path>)
13
use `StandardJavaFileManager.getJavaFileObjectsFromPaths(Collection)` instead, to prevent the possibility of accidentally calling the method with a single `Path` as such an argument. Although `Path` implements `Iterable<Path>`, it would almost never be correct to pass a single `Path` and have it be treated as an `Iterable` of its components.
javax.tools.ToolProvider.getSystemToolClassLoader()
9
This method is subject to removal in a future version of Java SE. Use the system tool provider or service loader mechanisms to locate system tools as well as user-installed tools.
javax.xml.stream.XMLEventFactory.newInstance(String, ClassLoader)
1.7
This method has been deprecated to maintain API consistency. All newInstance methods have been replaced with corresponding newFactory methods. The replacement `XMLEventFactory.newFactory(java.lang.String, java.lang.ClassLoader)` method defines no changes in behavior.
javax.xml.stream.XMLInputFactory.newInstance(String, ClassLoader)
1.7
This method has been deprecated to maintain API consistency. All newInstance methods have been replaced with corresponding newFactory methods. The replacement `XMLInputFactory.newFactory(java.lang.String, java.lang.ClassLoader)` method defines no changes in behavior.
javax.xml.stream.XMLOutputFactory.newInstance(String, ClassLoader)
1.7
This method has been deprecated because it returns an instance of XMLInputFactory, which is of the wrong class. Use the new method `XMLOutputFactory.newFactory(java.lang.String, java.lang.ClassLoader)` instead.
jdk.net.Sockets.getOption(DatagramSocket, SocketOption<T>)
16
use `DatagramSocket.getOption(SocketOption)` instead.
jdk.net.Sockets.getOption(ServerSocket, SocketOption<T>)
16
use `ServerSocket.getOption(SocketOption)` instead.
jdk.net.Sockets.getOption(Socket, SocketOption<T>)
16
use `Socket.getOption(SocketOption)` instead.
jdk.net.Sockets.setOption(DatagramSocket, SocketOption<T>, T)
16
use `DatagramSocket.setOption(SocketOption, Object)` instead.
jdk.net.Sockets.setOption(ServerSocket, SocketOption<T>, T)
16
use `ServerSocket.setOption(SocketOption, Object)` instead.
jdk.net.Sockets.setOption(Socket, SocketOption<T>, T)
16
use `Socket.setOption(SocketOption, Object)` instead.
jdk.net.Sockets.supportedOptions(Class<?>)
16
use `Socket.supportedOptions()`, `ServerSocket.supportedOptions()`, or `DatagramSocket.supportedOptions()` instead.
org.ietf.jgss.GSSContext.acceptSecContext(InputStream, OutputStream)
11
The stream-based methods have been removed from RFC 8353. Use `GSSContext.acceptSecContext(byte[], int, int)` instead.
org.ietf.jgss.GSSContext.getMIC(InputStream, OutputStream, MessageProp)
11
The stream-based methods have been removed from RFC 8353. Use `GSSContext.getMIC(byte[], int, int, MessageProp)` instead.
org.ietf.jgss.GSSContext.initSecContext(InputStream, OutputStream)
11
The stream-based methods have been removed from RFC 8353. Use `GSSContext.initSecContext(byte[], int, int)` instead.
org.ietf.jgss.GSSContext.unwrap(InputStream, OutputStream, MessageProp)
11
The stream-based methods have been removed from RFC 8353. Use `GSSContext.unwrap(byte[], int, int, MessageProp)` instead.
org.ietf.jgss.GSSContext.verifyMIC(InputStream, InputStream, MessageProp)
11
The stream-based methods have been removed from RFC 8353. Use `GSSContext.verifyMIC(byte[], int, int, byte[], int, int, MessageProp)` instead.
org.ietf.jgss.GSSContext.wrap(InputStream, OutputStream, MessageProp)
11
The stream-based methods have been removed from RFC 8353. Use `GSSContext.wrap(byte[], int, int, MessageProp)` instead.

Deprecated Constructors
Constructor
Deprecated in
Description
com.sun.jdi.Bootstrap()
16
com.sun.tools.javac.Main()
16
java.awt.AWTEvent(Event)
9
It is recommended that `AWTEvent(Object, int)` be used instead
java.awt.event.KeyEvent(Component, int, long, int, int)
as of JDK1.1; use `KeyEvent(Component, int, long, int, int, char)` instead
java.io.StreamTokenizer(InputStream)
As of JDK version 1.1, the preferred way to tokenize an input stream is to convert it into a character stream, for example:

        Reader r = new BufferedReader(new InputStreamReader(is));
        StreamTokenizer st = new StreamTokenizer(r);

java.lang.Boolean(boolean)
9
It is rarely appropriate to use this constructor. The static factory `Boolean.valueOf(boolean)` is generally a better choice, as it is likely to yield significantly better space and time performance. Also consider using the final fields `Boolean.TRUE` and `Boolean.FALSE` if possible.
java.lang.Boolean(String)
9
It is rarely appropriate to use this constructor. Use `Boolean.parseBoolean(String)` to convert a string to a `boolean` primitive, or use `Boolean.valueOf(String)` to convert a string to a `Boolean` object.
java.lang.Byte(byte)
9
It is rarely appropriate to use this constructor. The static factory `Byte.valueOf(byte)` is generally a better choice, as it is likely to yield significantly better space and time performance.
java.lang.Byte(String)
9
It is rarely appropriate to use this constructor. Use `Byte.parseByte(String)` to convert a string to a `byte` primitive, or use `Byte.valueOf(String)` to convert a string to a `Byte` object.
java.lang.Character(char)
9
It is rarely appropriate to use this constructor. The static factory `Character.valueOf(char)` is generally a better choice, as it is likely to yield significantly better space and time performance.
java.lang.Double(double)
9
It is rarely appropriate to use this constructor. The static factory `Double.valueOf(double)` is generally a better choice, as it is likely to yield significantly better space and time performance.
java.lang.Double(String)
9
It is rarely appropriate to use this constructor. Use `Double.parseDouble(String)` to convert a string to a `double` primitive, or use `Double.valueOf(String)` to convert a string to a `Double` object.
java.lang.Float(double)
9
It is rarely appropriate to use this constructor. Instead, use the static factory method `Float.valueOf(float)` method as follows: `Float.valueOf((float)value)`.
java.lang.Float(float)
9
It is rarely appropriate to use this constructor. The static factory `Float.valueOf(float)` is generally a better choice, as it is likely to yield significantly better space and time performance.
java.lang.Float(String)
9
It is rarely appropriate to use this constructor. Use `Float.parseFloat(String)` to convert a string to a `float` primitive, or use `Float.valueOf(String)` to convert a string to a `Float` object.
java.lang.Integer(int)
9
It is rarely appropriate to use this constructor. The static factory `Integer.valueOf(int)` is generally a better choice, as it is likely to yield significantly better space and time performance.
java.lang.Integer(String)
9
It is rarely appropriate to use this constructor. Use `Integer.parseInt(String)` to convert a string to a `int` primitive, or use `Integer.valueOf(String)` to convert a string to an `Integer` object.
java.lang.Long(long)
9
It is rarely appropriate to use this constructor. The static factory `Long.valueOf(long)` is generally a better choice, as it is likely to yield significantly better space and time performance.
java.lang.Long(String)
9
It is rarely appropriate to use this constructor. Use `Long.parseLong(String)` to convert a string to a `long` primitive, or use `Long.valueOf(String)` to convert a string to a `Long` object.
java.lang.reflect.AccessibleObject()
17
java.lang.Short(short)
9
It is rarely appropriate to use this constructor. The static factory `Short.valueOf(short)` is generally a better choice, as it is likely to yield significantly better space and time performance.
java.lang.Short(String)
9
It is rarely appropriate to use this constructor. Use `Short.parseShort(String)` to convert a string to a `short` primitive, or use `Short.valueOf(String)` to convert a string to a `Short` object.
java.lang.String(byte[], int)
1.1
This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the `String` constructors that take a `Charset`, charset name, or that use the `default charset`.
java.lang.String(byte[], int, int, int)
1.1
This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the `String` constructors that take a `Charset`, charset name, or that use the `default charset`.
java.net.Socket(String, int, boolean)
1.1
The `stream` parameter provided a way in early JDK releases to create a `Socket` that used a datagram socket. This feature no longer exists. Instead use `DatagramSocket` for datagram sockets.
java.net.Socket(InetAddress, int, boolean)
1.1
The `stream` parameter provided a way in early JDK releases to create a `Socket` that used a datagram socket. This feature no longer exists. Instead use `DatagramSocket` for datagram sockets.
java.net.URL(String)
20
Use `URI.toURL()` to construct an instance of URL. See the note on constructor deprecation for more details.
java.net.URL(String, String, int, String)
20
Use `URI.toURL()` to construct an instance of URL. See the note on constructor deprecation for more details.
java.net.URL(String, String, int, String, URLStreamHandler)
20
Use `URL.of(URI, URLStreamHandler)` to construct an instance of URL associated with a custom protocol handler. See the note on constructor deprecation for more details.
java.net.URL(String, String, String)
20
Use `URI.toURL()` to construct an instance of URL. See the note on constructor deprecation for more details.
java.net.URL(URL, String)
20
Use `URI.toURL()` to construct an instance of URL. See the note on constructor deprecation for more details.
java.net.URL(URL, String, URLStreamHandler)
20
Use `URL.of(URI, URLStreamHandler)` to construct an instance of URL associated with a custom protocol handler. See the note on constructor deprecation for more details.
java.rmi.RMISecurityException(String)
no replacement
java.rmi.RMISecurityException(String, String)
no replacement
java.rmi.server.Operation(String)
no replacement
java.rmi.server.SkeletonMismatchException(String)
no replacement
java.rmi.ServerRuntimeException(String, Exception)
no replacement
java.security.AuthProvider(String, double, String)
9
use `AuthProvider(String, String, String)` instead.
java.security.Provider(String, double, String)
9
use `Provider(String, String, String)` instead.
java.security.spec.PSSParameterSpec(int)
19
This constructor uses the default values defined in the PKCS #1 standard except for the salt length. Some of these defaults are no longer recommended due to advances in cryptanalysis -- see the PKCS#1 v2.2 standard for more details. Thus, it is recommended to explicitly specify all desired parameter values with the `PSSParameterSpec(String, String, AlgorithmParameterSpec, int, int)` constructor.
java.sql.Date(int, int, int)
1.2
instead use the constructor `Date(long date)`
java.sql.Time(int, int, int)
1.2
Use the constructor that takes a milliseconds value in place of this constructor
java.sql.Timestamp(int, int, int, int, int, int, int)
1.2
instead use the constructor `Timestamp(long millis)`
java.util.Date(int, int, int)
As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date)` or `GregorianCalendar(year + 1900, month, date)`.
java.util.Date(int, int, int, int, int)
As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date, hrs, min)` or `GregorianCalendar(year + 1900, month, date, hrs, min)`.
java.util.Date(int, int, int, int, int, int)
As of JDK version 1.1, replaced by `Calendar.set(year + 1900, month, date, hrs, min, sec)` or `GregorianCalendar(year + 1900, month, date, hrs, min, sec)`.
java.util.Date(String)
As of JDK version 1.1, replaced by `DateFormat.parse(String s)`.
java.util.Locale(String)
19
Locale constructors have been deprecated. See Obtaining a Locale for other options.
java.util.Locale(String, String)
19
Locale constructors have been deprecated. See Obtaining a Locale for other options.
java.util.Locale(String, String, String)
19
Locale constructors have been deprecated. See Obtaining a Locale for other options.
javax.lang.model.util.AbstractAnnotationValueVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.AbstractAnnotationValueVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.AbstractElementVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.AbstractElementVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.AbstractTypeVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.AbstractTypeVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementKindVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementKindVisitor6(R)
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementKindVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementKindVisitor7(R)
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementScanner6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementScanner6(R)
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementScanner7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.ElementScanner7(R)
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleAnnotationValueVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleAnnotationValueVisitor6(R)
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleAnnotationValueVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleAnnotationValueVisitor7(R)
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleElementVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleElementVisitor6(R)
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleElementVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleElementVisitor7(R)
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleTypeVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleTypeVisitor6(R)
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleTypeVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.SimpleTypeVisitor7(R)
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.TypeKindVisitor6()
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.TypeKindVisitor6(R)
9
Release 6 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.TypeKindVisitor7()
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.lang.model.util.TypeKindVisitor7(R)
12
Release 7 is obsolete; update to a visitor for a newer release level.
javax.management.AttributeValueExp()
An instance created with this constructor cannot be used in a query.
javax.management.modelmbean.DescriptorSupport(String)
25
This constructor exists for historical reasons. If reading from XML is required, it should be implemented externally.
javax.management.relation.RoleStatus()
16

Deprecated Enum Constants
Enum Constant
Deprecated in
Description
com.sun.security.jgss.InquireType.KRB5_GET_SESSION_KEY
as of 9, replaced by `InquireType.KRB5_GET_SESSION_KEY_EX` which returns an instance of `EncryptionKey` that implements the `SecretKey` interface and has similar methods with `KerberosKey`.