The finalization mechanism has been deprecated for removal in a future release. The `finalize` methods in standard Java APIs, such as `Object.finalize()` and `Enum.finalize()`, have also been deprecated for removal in a future release, along with methods related to finalization, such as `Runtime.runFinalization()` and `System.runFinalization()`.
Finalization remains enabled by default, but it can be disabled for testing purposes by using the command-line option `--finalization=disabled` introduced in this release. Maintainers of libraries and applications that rely upon finalization should migrate to other resource management techniques in their code, such as [try-with-resources](https://dev.java/learn/catching-and-handling-exceptions/#anchor_6) and [cleaners](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ref/Cleaner.html).
See [JEP 421](https://openjdk.java.net/jeps/421) for further information.