Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Cursor Bug Report: Java project classpath reintroduces internal build/libs jars after restart
Summary
Cursor’s Java tooling reintroduces internal subproject build/libs/*.jar entries into the live Eclipse/JDT classpath after restart, even when the Gradle/Buildship model resolves those same dependencies as project references.
This causes local multi-project Gradle dependencies to behave like jar dependencies instead of live project/classfile dependencies during development.
Environment
OS: Windows 11
Cursor
Java extension stack bundled with Cursor
Workspace: multi-project Gradle build
Repo root: C:\Users<USER>\git<REPO>
Observed Java server startup includes:
-Djava.import.generatesMetadataFilesAtProjectRoot=false
Affected example
Project:
admin-tools
Internal Gradle project dependencies:
project(“:server-common”)
project(“:db-common”)
project(“:runtime-common”)
Expected behavior
After restarting Cursor and importing the Gradle workspace:
local Gradle subproject dependencies should remain project references in the live Java project model
Cursor should not re-add internal jars from:
server-common/build/libs/.jar
db-common/build/libs/.jar
runtime-common/build/libs/*.jar
Actual behavior
After restart, admin-tools shows internal jars again in Project Settings / Classpath / Libraries, for example:
C:\Users<USER>\git<REPO>\runtime-common\build\libs\runtime-common-20260420175810.jar
C:\Users<USER>\git<REPO>\db-common\build\libs\db-common-20260420175810.jar
C:\Users<USER>\git<REPO>\server-common\build\libs\server-common-20260420175810.jar
These entries come back even if manually removed before restart.
- Buildship saved model is correct
File:
C:\Users<USER>\AppData\Roaming\Cursor\User\workspaceStorage\5baaec092d306f62d1591afa2ed486bd\redhat.java\jdt_ws.metadata.plugins\org.eclipse.buildship.core\project-preferences\admin-tools
Observed contents:
contains project refs such as:
/server-common
/db-common
/runtime-common
contains external dependencies from .gradle\caches
does not contain internal repo jar paths under /*/build/libs
This indicates Buildship is generating the desired model.
- Live Eclipse/JDT classpath is wrong
File:
C:\Users<USER>\AppData\Roaming\Cursor\User\workspaceStorage\5baaec092d306f62d1591afa2ed486bd\redhat.java\jdt_ws.metadata.plugins\org.eclipse.core.resources.projects\admin-tools.classpath
Observed contents include:
This indicates the live Eclipse/JDT project classpath is being materialized incorrectly after the Buildship model is already correct.Additional findings
Repo-root admin-tools/.classpath was deleted before restart and did not get recreated.
The active bad classpath came back under workspaceStorage, not the repo root.
Java logs show multiple importers are active, including:
GradleBuildServerProjectImporter
GradleProjectImporter
EclipseProjectImporter
This suggests the incorrect jar entries are likely being introduced in Cursor’s Java import/runtime pipeline after Buildship model generation.
Impact
breaks expected live multi-module development workflow
causes stale or timestamped jar references to reappear on restart
makes Cursor prefer built jar artifacts over local project/classfile references
can trigger missing-library errors when timestamped jars change
Workarounds tried
Gradle eclipse.classpath.file.whenMerged customization
direct .classpath cleanup
targeted project-reference injection
deleting cached classpath files before restart
These confirm the Buildship model can be made correct, but Cursor still reintroduces internal jar entries in the live classpath.
Suggested investigation area
Please inspect how Cursor materializes org.eclipse.buildship.core.gradleclasspathcontainer into the live JDT/Eclipse project classpath, especially when Buildship’s saved model already contains project references for local Gradle subprojects.
Steps to Reproduce
Open the Gradle multi-project workspace in Cursor.
Ensure admin-tools depends on local subprojects via implementation project(…).
Restart Cursor and let Java/Gradle import complete.
Open admin-tools Project Settings / Classpath / Libraries.
Observe that internal build/libs/*.jar entries have been added.
Expected Behavior
Generated jar files should not be automatically added to the classpath on restart of cursor
Operating System
Windows 10/11
Version Information
Version: 3.1.17 (system setup)
VSCode Version: 1.105.1
Commit: fce1e9ab7844f9ea35793da01e634aa7e50bce90
Date: 2026-04-19T19:33:58.189Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200
Does this stop you from using Cursor
No - Cursor works, but with this issue