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

Kevin Walls kevinw at openjdk.org
Tue Jan 6 11:53:53 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)

"VM.classes -verbose" is _very_ verbose already, so a separate option looks like the right choice to me.  More lightweight queries for just this info.

$ build/linux-x64/images/jdk/bin/jcmd 741576 VM.classes | wc -l
544
$ build/linux-x64/images/jdk/bin/jcmd 741576 VM.classes -verbose | wc -l
18209
(on a trivial test app)

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

PR Comment: https://git.openjdk.org/jdk/pull/29048#issuecomment-3714418866


More information about the hotspot-dev mailing list