False dependency errors with local JAR files in Java projects

Description:

Expected Behavior

When a JAR file is properly referenced in .vscode/settings.json and the code compiles/runs correctly, Cursor should recognize the dependencies and not show false error indicators.

Current Behavior

Cursor shows false error indicators (e.g., “package com.google.gson does not exist”) even when:

  • The JAR file (gson-2.11.0.jar) is properly placed in the lib folder
  • The JAR is correctly referenced in settings.json
  • The code compiles and runs successfully

Steps to Reproduce

  1. Create a new Java project

  2. Add a lib folder with gson-2.11.0.jar

  3. Configure settings.json with:
    {
    “java.project.sourcePaths”: [“src”],
    “java.project.outputPath”: “bin”,
    “java.project.referencedLibraries”: [“lib//.jar”]
    }

  4. Create a simple Java file that uses Gson

  5. Code runs correctly but IDE shows false errors

Environment

  • Cursor Version: [tu versión]
  • OS: Linux
  • Java Version: OpenJDK 21

Additional Context

  • The code compiles and runs without issues
  • Only the IDE’s error detection is affected

:white_check_mark: Check the forum to ensure the issue hasn’t been reported already
:lady_beetle: Provide a clear description of the bug
:arrows_counterclockwise: Explain how to reproduce the bug (if known)
:camera: Attach screenshots or recordings (e.g., .jpg, .png, .mp4).
:computer: Tell us your operating system and your Cursor version (e.g., Windows, 0.x.x).
:no_entry_sign: Tell us if the issue stops you from using Cursor.

Hey, Cursor has no Java linting built in, so this is likely an extension that is incorrectly linting your code. Check what extensions you have, and confirm they are configured correctly, as Cursor has no out-of-the-box support for this.

Cursor mirrors the setup for Java with VSCode, so this guide can be applied to Java setup in Cursor: