2

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 :)

2
  • Could you check the Project SDK being used for the project in IntelliJ? Commented Aug 25, 2018 at 10:31
  • @ItachiUchiha The project SDK for the desktop version was for some reason selected to "<No SDK>. Switching this to SDK 10, then pushing to git fixed the error. Thank you! Commented Aug 25, 2018 at 15:43

2 Answers 2

8

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.