Java Cup
Inside Java

News and views from members of the Java team at Oracle

Quality Outreach Heads-up - JDK 24: Retiring the Security Manager

The OpenJDK Quality Group is promoting the testing of FOSS projects with OpenJDK builds as a way to improve the overall quality of the release. This heads-up is part of a regular communication sent to the projects involved. To learn more about the program, and how-to join, please check here.

The Security Manager is a Legacy Feature with High Costs and Low Adoption

Introduced to enforce the principle of the least privilege, the Security Manager was designed to prevent unauthorized code from accessing sensitive resources like files or network connections. While effective in theory, it has fallen short in practice for several reasons:

Over the years, however, the Security Manager's complexity, limited adoption, and maintenance costs have outweighed its benefits. With its deprecation in Java 17 and the near absence of community feedback, it has become clear that the Security Manager’s time has passed.

Phasing Out the Security Manager

In Java 17, the Security Manager was deprecated for removal under JEP 411. In the future, with JDK 24, its functionality will be effectively disabled. The key changes include:

Developers and enterprises using older Java versions or legacy applications dependent on the Security Manager will retain access until JDK 24. Beyond that, they are encouraged to transition to alternative sandboxing and API interception mechanisms.

Some applications have used the Security Manager to intercept calls to the Java Platform API, such as blocking calls to System.exit. While this is not a security concern in most cases, interception remains helpful in debugging or managing application behavior. Below are a few alternative approaches that provide more reliability than the Security Manager’s interception mechanisms:

Taking Action

The deprecation of the Security Manager in JDK 17 had little to no impact on most Java developers. Warnings issued in JDK 17–23 generated minimal discussion in the Java ecosystem, highlighting its limited relevance. Furthermore, major frameworks and tools such as Jakarta EE, Ant, and Tomcat have already removed support for the Security Manager, reinforcing the trend.

For applications still dependent on the Security Manager, the JDK offers options to identify and address its usage:

These tools give code maintainers the necessary insights to transition away from the Security Manager before its complete removal in future JDK releases. By taking these steps, you can ensure a smooth transition from the Security Manager while adopting more effective security practices.

More Details

This is a summary; for more details make sure to read JEP 486.

~