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

前端 未结 8 1746
谎友^
谎友^ 2020-12-30 00:01

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 look

相关标签:
8条回答
  • 2020-12-30 00:40

    Try to rebuild the module using Ctrl+Shift+F9 or right click on the module and select "Rebuild " in menu.

    0 讨论(0)
  • 2020-12-30 00:42

    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 ++

    0 讨论(0)
  • 2020-12-30 00:46

    I fixed this error by disabling Kotlin plugin since I am not using it and the problem is solved

    0 讨论(0)
  • 2020-12-30 00:48

    Update your module-info.java file

    requires javafx.fxml;
    requires javafx.controls;
    requires javafx.graphics;
    requires javafx.web;
    
    opens sample;
    
    opens sample.controller;
    

    It opens the package (eg. sample) which contains your Launcher file and opens package conatinsyoyr controllers and its corresponding fxml files (eg. sample.controller)

    0 讨论(0)
  • 2020-12-30 00:52

    I had the same issue. Here is what worked:

    1. On IntellijIDEA go to 'Tools' menu at the top of the application: IntelliJ IDEA IDE.
    2. Then scroll down to 'Kotlin'.
    3. Click 'Configure Kotlin in Project'.
    0 讨论(0)
  • 2020-12-30 00:53

    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.

    I hope this helps.

    0 讨论(0)
提交回复
热议问题