Skip to content

Declare the Java debugger module for the AI debugger on 2026.1+ (EDU-9198) - #64

Merged
Tsyklop merged 2 commits into
mainfrom
bug/edu-9198-java-debugger-module
Nov 6, 2026
Merged

Tsyklop merged 2 commits into
mainfrom
bug/edu-9198-java-debugger-module

Conversation

@Tsyklop

@Tsyklop Tsyklop commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Fixes EDU-9198: ClassNotFoundException: com.intellij.debugger.ui.breakpoints.JavaLineBreakpointType on IDEA 2026.2 and 2026.3. Because of it, the AI debugger's JvmAIDebuggerBreakpointType can't be created.

Cause

Since 2026.2 the Java plugin's intellij.java.debugger.impl content module (JavaLineBreakpointType, DebugProcessImpl, JavaBreakpointHandlerFactory) is optional and has its own classloader. In 2026.1 it was required-if-available, so a dependency on the Java plugin was enough to see it.

ai-debugger-jvm only declares <plugin id="com.intellij.modules.java"/>. On 2026.2+ that gives it intellij.java.backend as its only Java classloader parent, so the superclass of JvmAIDebuggerBreakpointType can't be loaded. It fails in two places:

  • Any project without saved debugger state: XDebuggerManagerImpl.createDefaultBreakpoints creates every registered breakpoint type at startup.
  • Opening a JVM course: AIBreakPointsStartupActivity → AIBreakPointService.initialize → JvmBreakpointTypeManager.

Compilation and tests can't catch it, because both run on a flat classpath that contains every Java plugin module.

Fix

ai-debugger-jvm.xml declares <module name="intellij.java.debugger.impl"/>. processResources inserts it in place of a marker comment only when environmentName >= 261, the same approach as hs-sql-jvm. The module doesn't exist on 2025.2/2025.3, where these classes are in the Java plugin's main module, and declaring it there would stop ai-debugger-jvm from loading.

Testing

  • Generated descriptors: nothing is added for 253; the module is declared for 261, 262 and 263.
  • IDEA 2026.2.1 at runtime: I ran the sandbox IDE headless (runIdea --args="inspect …") on a fresh project with -Xlog:class+load.
    • Without the fix it logs Cannot create extension (class=…JvmAIDebuggerBreakpointType) caused by the same ClassNotFoundException.
    • With the fix, JavaLineBreakpointType and JvmAIDebuggerBreakpointType load with no error.
  • 2026.3 wasn't run: the cached EAP build has expired. Its Java plugin declares the module the same way as 2026.2.
  • Other plugins' optional modules: I scanned the class references in the 2026.21 distributions for 2026.2 and 2026.3 against the optional modules of every bundled plugin. This was the only one that wasn't declared.

Since 2026.2 `intellij.java.debugger.impl` is an optional content module of the Java plugin
with its own classloader, and a dependency on `com.intellij.modules.java` exposes only
`intellij.java.backend`. So ai-debugger-jvm could not load `JavaLineBreakpointType`, and
`JvmAIDebuggerBreakpointType` failed with ClassNotFoundException on startup (EDU-9198).

The module dependency is inserted by processResources for 2026.1+ only, because the module
does not exist in 2025.x, where these classes are part of the Java plugin's main module.
@Tsyklop
Tsyklop merged commit 9627aa2 into main Nov 6, 2026
0 of 2 checks passed
@Tsyklop
Tsyklop deleted the bug/edu-9198-java-debugger-module branch November 6, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant