简体   繁体   中英

Can't integrate JavaFX with Spring Boot in IntelliJ

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM