Skip to content

Java file cannot resolve Kotlin classes in mixed Kotlin/Java Gradle project #251

@abdulazizzisan

Description

@abdulazizzisan

Relevance Confirmation

  • I confirmed that this is not an issue with the Eclipse JDT Language Server itself

What happened?

Environment

  • Zed version:
    Zed 1.1.7
    Commit: c17f25cd782edffab64b7c4167abfa44f865b125
    Version: 1.1.7+stable.268.c17f25cd782edffab64b7c4167abfa44f865b125
  • OS:
    MacBook Air, Apple M4, macOS Tahoe 26.4.1 (25E253)
  • Java version: java 25.0.3 2026-04-21 LTS
  • Build tool: Gradle

Extensions Tested

I tested both:

  • Java v0.8.17
  • Java with Eclipse JDTLS v0.2.5

Both produced the exact same result.

Description

In a mixed Kotlin + Java Gradle project, Java files show unresolved symbol/type errors when referencing Kotlin classes, even though the project builds successfully with Gradle.

Kotlin files appear to work correctly, but Java diagnostics/navigation/completion do not recognize Kotlin classes.

This seems related to Java support being handled by JDTLS while Kotlin support is provided separately.

Example Error

The import com.zisan.payload.DynamicPagedResponse cannot be resolved

The referenced class is a Kotlin class and the Gradle build succeeds without issues.

Steps to Reproduce

  1. Create a Gradle project with both Java and Kotlin enabled.

  2. Add a Kotlin class:

  3. Reference it from Java:

  4. Open the project in Zed.

Actual Behavior

  • Java files show unresolved symbol/type errors for Kotlin classes.
  • Kotlin files appear fine.
  • Gradle build succeeds without issues.

Notes

This may be caused by JDTLS not recognizing Kotlin-generated sources/classes in the project model or classpath.

The issue does not affect compilation, only editor diagnostics/intellisense behavior.

What did you expect to happen?

Expected Behavior

  • Java files should resolve Kotlin classes correctly.
  • No diagnostics/errors should appear for valid Kotlin references.
  • Go-to-definition and autocomplete should work across Java ↔ Kotlin.

Environment

  • Zed version:
    Zed 1.1.7
    Commit: c17f25cd782edffab64b7c4167abfa44f865b125
    Version: 1.1.7+stable.268.c17f25cd782edffab64b7c4167abfa44f865b125
  • OS:
    MacBook Air, Apple M4, macOS Tahoe 26.4.1 (25E253)
  • Java version: java 25.0.3 2026-04-21 LTS
  • Build tool: Gradle

Metadata

Metadata

Assignees

No one assigned

    Labels

    language-serverRelated to the language server.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions