You cannot control the JVM process from your Java application running inside the JVM.
JDWP Debug Agent is a tool provided by the JVM and runs at a lower level than your application.
Shutdown hooks run before the JVM tears down subsystems, and the debug agent is destroyed after the shutdown hook
I would advise against using the shutdown hooks to provide resilience, as it can lead to restart loops.
Instead, you can offload the recovery to an external supervisor. In this example, a cron job is used. Or you can run the Java application from a parent process (eg, bash script) that will restart it if it crashes.