JetBrains/intellij-community · error · IllegalStateException

Interface method invocation is not supported in JVM

Error message

Interface method invocation is not supported in JVM {}. Use JVM 1.8.0_45 or higher to run {}

What it means

Thrown when the debugger evaluates a method call on an interface type and the target JVM's JDI implementation throws a LinkageError while invoking the interface method. Older JVMs (before 1.8.0_45) could not invoke static/default methods on interfaces via JDI. The message tells the user which JVM version is running the debuggee and the minimum version required.

Solutions

  1. Run the debuggee on JDK 1.8.0_45 or newer (set Project SDK / run configuration JRE to a modern JDK)
  2. Avoid evaluating interface default/static methods; call a concrete implementing class's method instead
  3. For remote debugging, point the debugger at a debuggee launched with a newer JVM and re-attach

Example fix

// before: debuggee launched with JDK 7
java -agentlib:jdwp=transport=dt_socket,server=y -version:1.7 MyApp

// after: debuggee launched with JDK 8u45+
java -agentlib:jdwp=transport=dt_socket,server=y MyApp
Defensive patterns

Strategy: validation

Validate before calling

// before invoking interface methods via JDI
if (SystemInfo.isJavaVersionAtLeast(8, 0, 45) || !isInterfaceType(target)) {
  value = interfaceType.invokeMethod(thread, method, args, policy);
} else {
  // route through a concrete implementing class instead
}

Try / catch

try {
  return interfaceType.invokeMethod(thread, method, args, invokePolicy);
} catch (LinkageError e) {
  // degrade gracefully: report old-JVM limitation, offer concrete-class call
}

Prevention

When it happens

Trigger: Evaluating an expression like 'interfaceVar.method()' or 'SomeInterface.staticMethod()' in the debugger evaluator while the debuggee runs on a JVM older than 1.8.0_45; the JDI ClassType/InterfaceType.invokeMethod call raises LinkageError (e.g. java.lang.NoSuchMethodError on java.lang.invoke machinery) and is wrapped in IllegalStateException.

Common situations: Debugging a legacy application running on JDK 6/7 or early JDK 8 builds; evaluating default or static interface methods introduced in Java 8; remote debugging an old application server (Tomcat 6, WebLogic) whose bundled JRE predates 8u45.

Related errors


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

Appendix: source

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

    InvocationResult result =
      tryInvokeWithHelper(interfaceType, null, method, args, (EvaluationContextImpl)evaluationContext, 0, false);
    if (result.isSuccess()) {
      return result.getValue();
    }
    return new InvokeCommand<>(method, args, (EvaluationContextImpl)evaluationContext) {
      @Override
      protected Value invokeMethod(ThreadReference thread, int invokePolicy, Method method, List<? extends Value> args)
        throws InvocationException, ClassNotLoadedException, IncompatibleThreadStateException, InvalidTypeException {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Invoking " + interfaceType.name() + "." + method.name());
        }

        try {
          //noinspection SSBasedInspection
          return interfaceType.invokeMethod(thread, method, args, invokePolicy);
        }
        catch (LinkageError e) {
          throw new IllegalStateException("Interface method invocation is not supported in JVM " +
                                          SystemInfo.JAVA_VERSION +
                                          ". Use JVM 1.8.0_45 or higher to run " +
                                          ApplicationNamesInfo.getInstance().getFullProductName());
        }
      }
    }.start(false);
  }


  @Override
  public ArrayReference newInstance(final ArrayType arrayType,
                                    final int dimension)
    throws EvaluateException {
    try {
      return arrayType.newInstance(dimension);
    }
    catch (Exception e) {
      throw EvaluateExceptionUtil.createEvaluateException(e);

View on GitHub (pinned to be881553f2)