code: private VirtualMachine listenTarget(int port, List<String> remoteVMOptions) {
          ListeningConnector listener = (ListeningConnector) connector;
          // Files to collection to output of a start-up failure
          File crashErrorFile = createTempFile("error");
          File crashOutputFile = createTempFile("output");
          try {
              // Start listening, get the JDI connection address
              String addr = listener.startListening(connectorArgs);
              debug("Listening at address: " + addr);
  
              // Launch the RemoteAgent requesting a connection on that address
              String javaHome = System.getProperty("java.home");
              List<String> args = new ArrayList<>();
              args.add(javaHome == null
                      ? "java"
                      : javaHome + File.separator + "bin" + File.separator + "java");
              args.add("-agentlib:jdwp=transport=" + connector.transport().name() +
                      ",address=" + addr);
              args.addAll(remoteVMOptions);
              args.add(remoteAgent);
              args.add("" + port);
              ProcessBuilder pb = new ProcessBuilder(args);
              pb.redirectError(crashErrorFile);
              pb.redirectOutput(crashOutputFile);
              process = pb.start();
  
              // Accept the connection from the remote agent
              vm = timedVirtualMachineCreation(() -> listener.accept(connectorArgs),
                      () -> process.waitFor());
              try {
                  listener.stopListening(connectorArgs);
              } catch (IOException | IllegalConnectorArgumentsException ex) {
                  // ignore
              }
              crashErrorFile.delete();
              crashOutputFile.delete();
              return vm;
          } catch (Throwable ex) {
              if (process != null) {
                  process.destroyForcibly();
              }
              try {
                  listener.stopListening(connectorArgs);
              } catch (IOException | IllegalConnectorArgumentsException iex) {
                  // ignore
              }
              String text = readFile(crashErrorFile) + readFile(crashOutputFile);
              crashErrorFile.delete();
              crashOutputFile.delete();
              if (text.isEmpty()) {
                  throw reportLaunchFail(ex, "listen");
              } else {
                  throw new IllegalArgumentException(text);
              }
          }
      }
docs: Directly launch the remote agent and connect JDI to it with a
  ListeningConnector.