Skip to content

Java Source Files side by side question #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
koush opened this issue May 27, 2020 · 4 comments
Closed

Java Source Files side by side question #212

koush opened this issue May 27, 2020 · 4 comments
Labels
bug Something isn't working java interop Interoperability with Java/JDT.LS

Comments

@koush
Copy link
Contributor

koush commented May 27, 2020

It is common for projects to have both java and kotlin source files. I've noticed that the kotlin language server does not recognize java source files within the project. Unresolved errors. Is this just an issue with my project?

My brief investigation of dependency resolution is that java dependencies do work via checking gradle dependencies, etc. But I was unable to determine if they work within the same project.

@koush
Copy link
Contributor Author

koush commented May 27, 2020

Found a related commit that indicates it should work?
#190

@fwcd
Copy link
Owner

fwcd commented May 27, 2020

Importing Java code into Kotlin within the same project should work (e.g. having src/main/java and src/main/kotlin). You might need to reload the language server after adding new Java files though. Are you using the latest version of the language server?

@fwcd fwcd added the bug Something isn't working label May 27, 2020
@koush
Copy link
Contributor Author

koush commented May 27, 2020

I use the release extension. I also tested with my own build of the language server when addressing another issue.

Let me double check the path. Old android projects put both java and kotlin files into src/ (no main/java or main/kotlin). I'll update and see if it resolves.

@koush
Copy link
Contributor Author

koush commented May 27, 2020

Before restructuring, I just reloaded the language server and it seems to be fixed. Maybe I had an older custom build running on accident.

@koush koush closed this as completed May 27, 2020
@fwcd fwcd added the java interop Interoperability with Java/JDT.LS label Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working java interop Interoperability with Java/JDT.LS
Projects
None yet
Development

No branches or pull requests

2 participants