Intellij Community 2018.3 seems to change project type from Java to Kotlin arbitratily

Answered

While I create a Maven multi-module project using JDK 11 when there is an error related to module exports and requires clauses IntelliJ suddenly shows this type of error.

It seems from that point onwards it becomes a Kotlin Project. I never create any Kotlin artifact.

 

Information:Kotlin: kotlinc-jvm 1.3.0 (JRE 11.0.1+13-LTS)
Information:12/3/2018 2:25 PM - Compilation completed with 1 error and 0 warnings in 3 s 396 ms
C:\Users\476458\IdeaProjects\GraphLayout\renderer\layout\src\main\java\module-info.java
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

 

My observation when this happens is this.

1. There are module-info.java errors related to exports and requires clauses.

2. There were Maven cyclic dependency errors.

But when I fix these It doesn't try to start a Kotlin JVM. Everything is back to normal.

 

Thanks,

Mohan

5
7 comments

Please report at https://youtrack.jetbrains.com/issues/KT with a sample project to reproduce.

0
Avatar
Permanently deleted user
7
Avatar
Permanently deleted user

I came across the same bug but I cannot replicate it. It seems to be connected with IOExceptions and BufferedReader/BufferedWriter classes.

 

Nbapankui solution of "Build->Rebuild Project" solved the issue for me as well.

 

2
Avatar
Permanently deleted user

I also encounter the same issue..

solution of "Build->Rebuild Project" solved the issue.

1
Avatar
Permanently deleted user

Same here,

solved like all my predecessors on this thread

0
Avatar
Permanently deleted user

I think this issue is caused by copy pasting some code into a Java class that the compiler interprets as Kotlin. Intellij then immediately looks for a Kotlin library for the containing module/project and if it can't find one then this is the error you get.

1
Avatar
Permanently deleted user

That solved my problem too. Thanks a ton.

0

Please sign in to leave a comment.