Hi Denis,
The Java Language Server (JDT LS) bundled with the Red Hat extension is the same engine used in VS Code, so Maven import hangs like this are fairly well documented. That said, Cursor runs its own indexing alongside the extension, which can add some resource contention. The fact that a fresh checkout works for a day or two before failing again suggests workspace metadata or cache corruption building up over time.
Since you’ve already tried the usual workspace cleanups, a few additional things to check:
1. Inspect the process during the hang
When the import stalls at 22%, open Task Manager and check the java.exe process.
-
If CPU is maxed out, the language server may be hitting a memory limit.
-
If it’s mostly idle, it may be waiting on a Maven download or stuck in a deadlock.
2. Increase JDT LS memory
The language server heap may be too small for a large Maven project. In Cursor Settings (Ctrl + ,), set java.jdt.ls.vmargs to:
-XX:+UseParallelGC
-XX:GCTimeRatio=4
-XX:AdaptiveSizePolicyWeight=90
-Dsun.zip.disableMemoryMapping=true
-Xmx4G
-Xms512m
The default is often ~1 GB, which can be insufficient for bigger projects.
3. Clean the local Maven repository
Corrupted artifacts in ~/.m2 persist across Cursor reinstalls and workspace resets. Try deleting:
C:\Users\<your-username>\.m2\repository
or run:
mvn dependency:purge-local-repository
to force Maven to re-download dependencies.
4. Reduce import scope
In Cursor Settings:
-
java.import.exclusions: add**/node_modules/**,**/target/**,**/.git/** -
java.autobuild.enabled:false -
java.import.maven.offline.enabled:true(if dependencies are already downloaded)
5. Verify the project builds outside Cursor
Run:
mvn clean install -U
If this also hangs or fails, the issue is likely in the Maven project itself rather than the language server.
6. Try the same project in VS Code
Open the project in VS Code with the same Red Hat Java extension.
-
If it also hangs at 22%, it’s likely an extension or project-level issue.
-
If it works there, that points to a Cursor-specific interaction we should investigate.
One additional note: your logs show JDT LS 1.57.0-SNAPSHOT, which is a pre-release build. If the steps above don’t help, it may be worth downgrading to the latest stable extension to rule out a regression.
If the issue persists, could you share the full Java Language Server log? You can open it via Ctrl+Shift+P → “Java: Open Java Language Server Log File.” That should help pinpoint where the import is getting stuck.
Best,
Mohit