LocalAttachInfo (List<String> arguments, String pid) { String address; boolean socket; for (String argument : arguments) { if (argument.startsWith("-agentlib:jdwp") && argument.contains("server=y") && (argument.contains("transport=dt_shmem") || argument.contains("transport=dt_socket"))) { socket = argument.contains("transport=dt_socket"); String[] params = argument.split(","); for (String param : params) { if (param.startsWith("address")) { try { address = param.split("=")[1]; address = StringUtil.trimStart(address, "*:"); // handle java 9 format: *:5005 return new DebuggerLocalAttachInfo(socket, address, null, pid, null, false); } catch (Exception e) { LOG.error(e); return null; } } } break; } } return null; }