RFR: 8327246: Add a jcmd diagnostic command to list the jar files loaded by a process

Leonid Mesnik lmesnik at openjdk.org
Mon Jan 5 22:23:39 UTC 2026


On Mon, 5 Jan 2026 20:16:37 GMT, Larry Cable <duke at openjdk.org> wrote:

> modified the pre-existing VM.classes jcmd to add a 'location' option, that when specified, will (natively) attempt to obtain the value (if non-null) of the location URL of the CodeSource of each classes ProtectionDomain.
> 
> effectively:
> 
> someObject.getClass().getProtectionDomain().getCodeSource().getLocation().toExternalForm()
> 
> (where interim oops are null-checked)

Changes requested by lmesnik (Reviewer).

src/hotspot/share/services/diagnosticCommand.cpp line 962:

> 960:            "S = is shared class",
> 961:            "BOOLEAN", false, "false"),
> 962:   _location("-location", "print class file location url (if available)", "BOOLEAN", false, "false") {

Not a review yet. But this new functionality deserve a regression test.

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

PR Review: https://git.openjdk.org/jdk/pull/29048#pullrequestreview-3628602391
PR Review Comment: https://git.openjdk.org/jdk/pull/29048#discussion_r2662962679


More information about the hotspot-dev mailing list