NotZack
NotZack

Reputation: 518

JavaFX Intellij error "Error:java: invalid flag: --add-modules=javafx.fxml,javafx.graphics,javafx.controls,javafx.base"

The error itself:

Error:java: invalid flag: --add-modules=javafx.fxml,javafx.graphics,javafx.controls,javafx.base

This error occurs when this javafx application is ran. I am running this project from a newly setup laptop and am not sure what i'm doing to cause this error, it works just fine on my desktop. I'm using intellij Community 2018.2 and JKD 10 on both my desktop and laptop.

Searching this error does not yield much information (to me) and i'm not really sure where to even start. I'm not using any fxml either if that makes a difference. Thanks for any help :)

Upvotes: 2

Views: 10742

Answers (2)

Bnrdo
Bnrdo

Reputation: 5474

You need to remove it from the compilation options. Go to Settings > Build, Execution, Deployment > Compiler > Java Compiler. In Javac Options you will see entries for the compilcation options for each projects. Remove it from there.

Upvotes: 8

NotZack
NotZack

Reputation: 518

Thanks to ItachiUchiha for leading me to the answer.

Checking the SDK for my pc revealed that there was no SDK selected. I'm not sure how it was working before.

No SDK

Switching this to SDK 10, the same SDK my laptop uses, then pushing the changes to git, then pulling from git on the laptop, solved the error.

SDK10

Upvotes: 1

Related Questions