The picture does not display after javaFX uses IDEA to package and export exe

Today, when I packaged and completed the JavaFX project with idea, I found two methods.

  • One is to directly package with ant in eclipse to form an installable exe file, see https://code.makery.ch/zh-cn/library/javafx-tutorial/part7/
  • The other is to use idea to directly build artifacts and directly export the built project.

Because of the idea I used, I chose the second method. (The disadvantage is that the packaged file is very large == It seems to be packaged into the operating environment together)

But after packaging, I found that the icons in the software interface are not displayed.

After various attempts, it was found that the file path of the picture was placed incorrectly. It must be placed in the resources folder under the src directory. Directly in the same directory as the code does not work. Seems to be a limitation of maven? ? ?

Insert picture description here

Guess you like

Origin blog.csdn.net/xiaohaigary/article/details/103325522