Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA Ultimate 2018.3 thinks my Java 9 Project is a Kotlin Project

I have an IntelliJ project composing several subprojects which are all Java 9 modules. I use Maven as a build system. My project has no "Facets". My run configuration looks like this: Run Configuration

My project settings look like this: Project Settings

I can build everything with Maven just fine. However, when I try to compile with IntelliJ, it somehow thinks that my project is a Kotlin project and can't compile it:

Error message

Error:Kotlin: The Kotlin standard library is not found in the module graph. Please ensure you have the 'requires kotlin.stdlib' clause in your module definition

Has anyone any idea how to fix this? I already tried deleting the run configuration and recreated it. This fixes the problem for some time, but then it reappears randomly.

like image 713
dax Avatar asked Nov 27 '18 10:11

dax


People also ask

How do I disable Kotlin plugin in IntelliJ?

Intellij provides 2 different settings. Project wise setting and global settings. This will open Project Settings window. You can select kotlin and remove there in the below screen.

Is IntelliJ built with Kotlin?

It is written in Kotlin just like the source code of your program.

How do I change the Kotlin compiler version in IntelliJ?

Go to Intellij Preferences -> Build, Execution, Deployment -> Kotlin Compiler. Update Language version and Api version to the one you wish. This should be the accepted answer.


2 Answers

Even in 2019.1.3 that error is there .

A solution that always works for me is :

Build menu => Rebuild Project

Tested with JDK 12.0.1


That should be fixed though by IntelliJ team as soon as possible as more and more Java projects are passing to JDK 11 ++

like image 115
GOXR3PLUS Avatar answered Sep 24 '22 23:09

GOXR3PLUS


I had the same problem. I worked in a pure Java project managed with Maven. Till some days ago I applied the solution "rebuild" the project, but sometimes the error came back again.

After more investigation, I found that after disable "Enable migration detection" menu, the problem disappears.

disable menu Enable migration detection

I hope this helps.

like image 45
xcesco Avatar answered Sep 24 '22 23:09

xcesco