code: public void shutdown() {
          shutdownCalled = true;
          if (isRunning()) {
              watchdog.waitForProcessStarted();
              watchdog.destroyProcess();
              watchdog.waitForTerminationAfterDestroy(2, SECONDS);
              if (isRunning()) {
                  watchdog.destroyProcessForcefully();
                  watchdog.waitForTerminationAfterDestroy(1, SECONDS);
                  if (isRunning()) {
                      LOGGER.severe(String.format("Unable to kill process with PID %s", watchdog.getProcessId()));
                  }
              }
          }
  
          // if shutdown() was called by something other than the shutdown hook, we don't need the shutdown hook anymore
          try {
              if (shutDownHook != null) {
                  Runtime.getRuntime().removeShutdownHook(shutDownHook);
              }
          } catch (IllegalStateException e) {
              // ignore.. happens when the shutdown hook is in use, that's okay
          }
  
      }
docs: Shuts down the instance represented by this launcher. Uses the {@link ProcessHandlerFactory} to find sub
  processes.