Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Describe the Bug
In a plain, idiomatic Gradle multi-module project, Cursor’s Java tooling treats
an internal project-to-project dependency as if it were an external binary
(Maven-style) dependency. This produces two distinct, reproducible symptoms that
do not occur in VS Code running the same Red Hat Java extension versions
against the same project.
The repro is a minimal 3-module Gradle build with the dependency chain
app → service → common:
service/build.gradle:api project(':common')app/build.gradle:implementation project(':service')
Both are standard Gradle project dependencies, and the build imports, compiles,
and runs cleanly (./gradlew clean run --args="world").
Bug 1 — Java Projects view shows an extra, errored root project.
The Java Projects explorer (vscjava.vscode-java-dependency) lists the three
real modules (app, common, service) plus an extra entry for the root
project, rendered in red with an error badge (1), even though the build
imports and compiles without errors.
Bug 2 — “Go To Definition” opens a built jar instead of project source.
Go To Definition on GreetingService (a type owned by the sibling :service
module) opens the decompiled class from service/build/libs/service-1.0.0.jar
instead of the real source at
service/src/main/java/com/example/service/GreetingService.java. The hover shows:
com.example.service.GreetingService
Source: service-1.0.0.jar = / version = / unknown / ... GreetingService.class
version = unknown is the tell — an internal project reference is being treated
as an external Maven-style binary dependency.
This is a tooling/consumption bug, not a build problem: every layer the language
server consumes expresses the dependency as project-to-source:
./gradlew :app:dependencies --configuration runtimeClasspathshows
\--- project :service \--- project :common(project-based, no jar).- The generated Eclipse/Buildship
app/.classpathcontains
<classpathentry kind="src" path="/service">and.../common(source
references, nolibentry forservice-1.0.0.jar). - The project builds and runs cleanly via the Gradle wrapper.
Correct model in, jar-based resolution out.
Steps to Reproduce
- Open the repro folder in Cursor with the Java extension pack installed
(versions below). - Let the Java language server finish importing the Gradle project.
- Open
app/src/main/java/com/example/app/Main.java. - Bug 1: open the Java Projects view → observe an extra root entry (red,
with a1error badge) alongsideapp,common,service. - Bug 2: Go To Definition (F12) on
GreetingService→ it opens the
decompiled class insideservice-1.0.0.jarinstead of the.javasource in
service/. - For contrast, open the same folder in VS Code with the same extension
versions: the extra root entry is absent and Go To Definition lands in the
.javasource.
Expected Behavior
- The Java Projects view lists only the real modules (
app,common,
service), with no extra/errored root entry — matching VS Code. - Go To Definition on
GreetingServiceopens
service/src/main/java/com/example/service/GreetingService.java, not a
decompiled class insideservice-1.0.0.jar— matching VS Code.
Screenshots / Screen Recordings
Operating System
MacOS
Version Information
| Component | Version |
|---|---|
| Cursor | 3.6.31 |
| JDK | Amazon Corretto 25.0.3 (LTS) |
| Gradle (wrapper) | 9.1.0 |
redhat.java |
1.54.0 |
vscjava.vscode-gradle |
3.17.3 |
vscjava.vscode-java-dependency |
0.27.4 |
vscjava.vscode-java-pack |
0.31.0 |
Does this stop you from using Cursor
Yes - Cursor is unusable

