31

Edit: Solved. See @acdsee's comment to see how.

Since I updated IntelliJ IDEA from 2017.3.5 to 2018.1, every project I start throws this error:

> Error:Module 'JBA' production: java.lang.Exception: LOGGING: Loading
> modules: [java.se, javafx.base, javafx.controls, javafx.fxml,
> javafx.graphics, javafx.media, javafx.swing, javafx.web,
> jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink,
> jdk.httpserver, jdk.incubator.httpclient, jdk.jartool, jdk.javadoc,
> jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject,
> jdk.management, jdk.management.cmm, jdk.management.jfr,
> jdk.management.resource, jdk.net, jdk.packager, jdk.packager.services,
> jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss,
> jdk.unsupported, jdk.xml.dom, oracle.desktop, oracle.net, java.base,
> java.compiler, java.datatransfer, java.desktop, java.xml,
> java.instrument, java.logging, java.management, java.management.rmi,
> java.rmi, java.naming, java.prefs, java.scripting, java.security.jgss,
> java.security.sasl, java.sql, java.sql.rowset, java.xml.crypto,
> jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent,
> jdk.internal.ed, jdk.internal.le, jdk.internal.opt, jdk.jlink] (no
> MessageCollector configured)
Samplasion
  • 527
  • 4
  • 17
  • 2
    Welcome to SO. Please have a look here to learn how to improve your questions (formatting, proofreading, providing code etc.): https://stackoverflow.com/help/how-to-ask – petezurich Apr 20 '18 at 20:40
  • 3
    Seeing the same thing. Using IntelliJ 2018.1.1, JDK 9.0.4+11, and Kotlin 1.2.40. If I make a change and just hit build I see the error above. If I clean and rebuild from scratch it works but this is a tedious workaround. – dewald Apr 21 '18 at 03:05
  • 10
    I had the same problem. In my case manualy deteting _out_ folder helped. Hope this help You too. – cycki Apr 21 '18 at 08:09
  • 2
    Same problem after update. Deleting _out_ helps, but issue returns back after some time – random Apr 21 '18 at 09:19
  • @random But at least you know what the problem is – Samplasion Apr 21 '18 at 09:32
  • 9
    I had the same problem. It seem that caused by kotlin plugin 1.2.40. rollback plugin to 1.2.31. the problem disappeared – DCjanus Apr 21 '18 at 12:05
  • Somebody, please report this bug in JetBrains Bug Tracker – Eldar Agalarov Apr 23 '18 at 19:48
  • 7
    Please vote https://youtrack.jetbrains.com/issue/KT-23901 – Tuno Apr 24 '18 at 05:53

2 Answers2

2

I had the same problem with Kotlin 1.2.40 and Java JDK 10. After every change in the code, I had to rebuild the whole project to get rid of the compilation error. Deleting of the out folder did help only until the next change. I was looking for the way to downgrade the Kotlin plugin to the previous version, but have found a better solution.

My IDEA project didn't have Gradle and I was able to solve the problem by adding Gradle to the project.

Just close the Project, put the following file "build.gradle" to the root folder and re-import the Project in the IntelliJ IDEA.

My file build.gradle looks so:

buildscript {
    ext.kotlin_version = '1.2.40'

    repositories {
        mavenCentral()
    }

    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

apply plugin: 'kotlin'

sourceSets {
    main.java.srcDirs += 'src'
}

repositories {
    mavenCentral()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}

It works well now with the Plugin Version 1.2.40. A downgrade to a previous version is not necessary.

Tolbxela
  • 4,767
  • 3
  • 21
  • 42
  • I have a Gradle file essentially the same as this one and I still have to delete the `out` directory every time. – Max Apr 28 '18 at 03:02
  • Following the bug trail that @Tuno posted, it looks like it's fixed and will go out in Kotlin 1.2.41. – Max Apr 28 '18 at 03:04
  • 1
    And to wrap this up, Kotlin 1.2.41 was released 4 hours ago. – Max Apr 28 '18 at 17:26
2

Promoting the answer in the comments to an answer, because it's the actual answer:

This appears to be a bug in the IntelliJ Kotlin plugin v1.2.40 and how it interacts with Java 10. See here. The solution is to upgrade to v1.2.41.

(Don't switch your project to building with Gradle like the other answer suggests just because the plugin is broken. That's weird.)