0
votes

I would like to integrate Spring Boot with JavaFX in IntelliJ environment. I've found this article about it.

But it isn't working for me. I have done these steps:

  1. Generate plain project using spring initializer.
  2. Import project (Maven project) in IntelliJ
  3. Now I can run spring boot application, and it works well.
  4. Make changes from the article.
  5. Run Spring application action, and then getting errors:

Errors:

Error:(7, 26) java: package javafX.application does not exist
Error:(8, 19) java: package javafx.fxml does not exist
Error:(9, 20) java: package javafx.scene does not exist
Error:(10, 20) java: package javafx.scene does not exist
Error:(11, 20) java: package javafx.stage does not exist
Error:(14, 37) java: cannot find symbol symbol: class Application

IntelliJ find sources of JavaFX packages. I can look into JavaFX code. But why cannot compile and run?

1
Are you using Java 8 or later?Stephen C
Java10. When I create new JavaFX project, it works well.mxst4
Check the java version used by IntelliJ, go to JAVA_HOME/jmods and JAVA_HOME/legal, verify if you have there javafx.* packages. I remember I had a similar issue and had to change java, as for some reason it did not contain JavaFX packages (that was not Java 11). Solution was to change java used by IntelliJ for the one which contained this packages.DevDio

1 Answers

0
votes

It's probably caused by IntelliJ which downgrade your java version. Try this solution:

File->Project Structure -> Project and check if Project SDK and Project language level is above 8.

You can also use shortcut: ctrl + shift + alt + s