1

I just started learning Javafx with Java11 I created a project in IntelliJ and it gave the standard structure. In src file when I change the package name for the package "sample" to anything else, IntelliJ gives the following error.

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

The error disappears when I refactor the package back to "sample".

how do I rename without getting this problem.

NitinDixit
  • 13
  • 4
  • Do you use Kotlin in your project? If not please try to disable Kotlin plugin. There is related issue on YouTrack: https://youtrack.jetbrains.com/issue/KT-27458 – y.bedrov Jan 03 '19 at 15:53
  • See also Maven project(s) having similar issues: https://stackoverflow.com/questions/53497454/intellij-idea-ultimate-2018-3-thinks-my-java-9-project-is-a-kotlin-project – Osmund Francis Oct 11 '19 at 07:21

4 Answers4

0

this might be helpfull

Javac gives this error, when lint is enabled and you use Java 9 module in Kotlin. You have to declare "requires kotlin.stdlib" in your module-info.java.

hce
  • 1,107
  • 9
  • 25
0

Ran into the same issue. For me, I'm using a module-info file in the src folder that looks like this:

module javafx {
    requires javafx.fxml;
    requires javafx.controls;
    requires javafx.graphics;
    opens sample;
}

If you rename your package to foo, then you need to change the last line to "opens foo". Otherwise it's still gonna look for and try to open a package named "sample". I have no idea what this has to do with kotlin.

J T
  • 1
0

I had the same problem and I solved it disabling "Kotlin migration detection". I have already response here:

https://stackoverflow.com/a/59628873/2350799

xcesco
  • 4,690
  • 4
  • 34
  • 65
0

I had the same problem. But as long as you are not using Kotlin in the project there is a workaround : disable the Kotlin plugin, under settings.

JayAudion
  • 1
  • 1