JDK-8278967 : rmiregistry fails to start because SecurityManager is disabled
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-12-17
  • Updated: 2021-12-23
  • Resolved: 2021-12-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18 JDK 19
18 masterFixed 19Fixed
Related Reports
Relates :  
Description
In JDK 18, attempting to run rmiregistry results in the following:

$ rmiregistry
java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
	at java.base/java.lang.System.setSecurityManager(System.java:416)
	at java.rmi/sun.rmi.registry.RegistryImpl.createRegistry(RegistryImpl.java:499)
	at java.rmi/sun.rmi.registry.RegistryImpl.main(RegistryImpl.java:556)

The workaround is to allow set the security manager property on the command line to allow programmatic setting of the security manager:

$ rmiregistry -J-Djava.security.manager=allow

Alternatively, the security manager could be enabled directly on the command line:

$ rmiregistry -J-Djava.security.manager

Either works, though they give different warning messages.

The property should be set by the rmiregistry launcher instead of requiring the user to provide it.

Comments
Changeset: 04ee9211 Author: Stuart Marks <smarks@openjdk.org> Date: 2021-12-22 18:56:30 +0000 URL: https://git.openjdk.java.net/jdk18/commit/04ee9211fcc59178b3bfdfdda5e0def9b0f29ada
22-12-2021

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk18/pull/45 Date: 2021-12-17 20:01:27 +0000
17-12-2021