JetBrains/intellij-community · error · CantRunException

The port to listen at unspecified

Error message

The port to listen at unspecified

What it means

Error "The port to listen at unspecified" thrown in JetBrains/intellij-community.

Source

Thrown at java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java:738

    try {
      if (myArguments != null) {
        throw new IOException(JavaDebuggerBundle.message("error.debugger.already.listening"));
      }

      final String port = myConnection.getDebuggerAddress();

      Connector connector = getConnector();
      myArguments = connector.defaultArguments();
      if (myConnection instanceof PidRemoteConnection && !((PidRemoteConnection)myConnection).isFixedAddress()) {
        String pid = ((PidRemoteConnection)myConnection).getPid();
        if (StringUtil.isEmpty(pid)) {
          throw new CantRunException(JavaDebuggerBundle.message("error.no.pid"));
        }
        setConnectorArgument("pid", pid);
      }
      else if (myConnection.isServerMode()) {
        if (port == null) {
          throw new CantRunException(JavaDebuggerBundle.message("error.no.debug.listen.port"));
        }
        String debuggerHostName = myConnection.getDebuggerHostName();
        if (debuggerHostName != null) {
          setConnectorArgument("localAddress", debuggerHostName);
        }
      }
      else { // is client mode, should attach to already running process
        if (myConnection.isUseSockets()) {
          String debuggerHostName = myConnection.getDebuggerHostName();
          if (debuggerHostName != null) {
            setConnectorArgument("hostname", debuggerHostName);
          }
          if (port == null) {
            throw new CantRunException(JavaDebuggerBundle.message("error.no.debug.attach.port"));
          }
          setConnectorArgument("port", port);
        }
        else {

View on GitHub (pinned to be881553f2)

Solutions

  1. Specify the port the debugger should listen on in the run/debug configuration.
  2. Choose a free local port, e.g. 5005.

Example fix

Run | Edit Configurations -> Remote JVM Debug -> Debugger mode: Listen -> Port: 5005.

When it happens

Trigger: A listen-mode remote debug configuration is started without a port.

Common situations: The Port field was cleared or never filled in a Remote JVM Debug configuration using Listen mode.


AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14). Data as JSON: /api/errors/5b4844bc3d2fe724. Report an issue: GitHub.