Reputation: 2556
I surprised, because i was able to checkout and run a Kotlin project from Github without this error, and now get get this Java-Error
I using
i tried hit Alt+Enter. IDE manual says: "Alt+Enter: Show intention actions and quick-fixes."
This is my File-Name:
/home/me/IdeaProjects/KeyEvent-Reader-Demo/src/Test.kt
Same Error i found here: https://discuss.kotlinlang.org/t/kotlin-unresolved-reference-java/6734
Upvotes: 3
Views: 19389
Reputation: 629
I had the same problem, the @y.bedrov's suggestion helps me.
The issue is that the Classpath
is empty (under Project Structure
-> Platform Settings
-> SDKs
-> <choose active SDK>
-> Classpath
)
To fix this, you can recreate the SDK:
Project Structure
-> Platform SDKs
-> <choose active SDK>
-> "-"
Project Structure
-> Platform SDKs
-> "+"
-> <choose target SDK location>
Upvotes: 10
Reputation: 1303
This was definitely some IntelliJ peoblem for me. I could solve the issue by stupidly deleting the "problematic" class and creating it again:
What generally people also suggest when having similar problem (but didn't help in my case):
Kotlin Compiler
and Java Compiler
match in versions.Upvotes: 2