RFR: 8364182: Add jcmd VM.properties command [v3]

Kevin Walls kevinw at openjdk.org
Thu Jan 8 21:04:41 UTC 2026


On Thu, 8 Jan 2026 20:35:33 GMT, Kieran Farrell <kfarrell at openjdk.org> wrote:

>> The goal of this PR is to add a means of exposing security properties at runtime to aid the debugging security related issues/misconfigurations etc. Currently, only initial security properties set at start up can be exposed via the `InitialSecurityProperty` JFR event. 
>> 
>> This patch introduces a new jcmd diagnostic command `VM.properties`, which enables developers to print either the current system properties or security properties of a running Java process via command-line arguments (-system or -security). To avoid clutter within the jcmd command list, the old `VM.system_properties` command is hidden, but not removed so will not break existing usages. The implementation of each is shared to reduce duplication.
>
> Kieran Farrell has updated the pull request incrementally with one additional commit since the last revision:
> 
>   rm unused code

src/hotspot/share/services/attachListener.cpp line 308:

> 306: }
> 307: 
> 308: // Implementation of "properties -security" command.

We don't need this: the attach API provides some basic commands, but most of the time we use the "jcmd" attach api command, which runs a DiagnosticCommand.  That's how we attach and run VM.properties etc...

This makes your life easier, we don't need serializeSecurityPropertiesToByteArray(), just updated DCmd and register_DCMDFactory lines.
(you'll need to merge in the later repo changes and resolve the register_DCMDFactory changes)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/29124#discussion_r2673891775


More information about the core-libs-dev mailing list