JavaFX and maven: NullPointerException: Location is required

后端 未结 6 1977
别跟我提以往
别跟我提以往 2020-11-28 07:03

I have been trying to get Maven set up with JavaFX. Even though I was unexperienced with Maven and JavaFX, I didn\'t expect it to be so much of a challenge. My Java knowledg

6条回答
  •  孤街浪徒
    2020-11-28 07:49

    For those who use gradle as their build system add this to your build.gradle file:

    sourceSets.main.resources {
        srcDirs = ["src/main/java"]; //assume that your java classes are inside this path
        exclude "**/*.java"
    }
    

    Then clean and rebuild your project.

    So what will it do? If you have a view.fxml inside your com.example.myfxapp package, after building your project it will exported to /resources/com/example/myfxapp/view.fxml

提交回复
热议问题