I would like to enable debugging at some point on the current JVM without adding the command line parameters -agentlib:jdwp
.
Is it possible to do so programmatically from within the current running JVM ? Without any third party libraries ?
Other command line parameters (such as -Djdk.attach.allowAttachSelf=true
) can be considered.
VirtualMachine vm = VirtualMachine.attach(Long.toString(ProcessHandle.current().pid()));
vm.loadAgentLibrary("jdwp", "transport=dt_socket,server=y,address=8000,suspend=n");
causes :
com.sun.tools.attach.AgentLoadException: Failed to load agent library: _Agent_OnAttach@12 is not available in jdwp