cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Kotlin-Java interop not working in Cursor while working in IntelliJ

Open juexuanl opened this issue 10 months ago • 0 comments

Title: Kotlin-Java Interoperability Not Working in Cursor IDE

Issue Description

Cursor IDE cannot resolve Kotlin classes from Java files, while the same code works correctly in IntelliJ IDEA.

Specific Problem

  • Java code cannot resolve Kotlin classes despite being in the same package
  • Error shown in Cursor: "XXXX cannot be resolved to a variable"
  • Same code builds and runs correctly in IntelliJ IDEA

Project Setup

  • Maven project with kotlin-maven-plugin
  • Mixed Java-Kotlin codebase
  • Both files in same package

Maven Configuration

<plugin>
    <artifactId>kotlin-maven-plugin</artifactId>
    <groupId>org.jetbrains.kotlin</groupId>
</plugin>

Attempted Solutions

  1. Proper import statement added
  2. Restarted Cursor
  3. Cleared Cursor cache
  4. Reloaded project
  5. Project builds and runs correctly outside Cursor

Expected Behavior

Cursor should recognize and resolve Kotlin classes from Java code, similar to IntelliJ IDEA.

Environment

  • Cursor Version: 0.49.4 (Universal)
  • VSCode Version: 1.96.2
  • Commit: ec408037b24566b11e6132c58bbe6ad27046eb90
  • Electron: 34.3.4
  • Chromium: 132.0.6834.210
  • Node.js: 20.18.3
  • V8: 13.2.152.41-electron.0
  • OS: Darwin arm64 24.4.0

juexuanl avatar Apr 23 '25 18:04 juexuanl