Javafx project doesn't compile with maven

后端 未结 1 1679
别跟我提以往
别跟我提以往 2021-01-01 21:41

I have a Java FX project and am using maven 3.0.5 to build. When i run mvn package/install, the project fails and complains that the package javafx.* doesn\'t exist

相关标签:
1条回答
  • 2021-01-01 22:09

    placing this in the dependencies (depending on where your jdk is) will help the dependency compile, however you should probably replace it with a variable that the user can specify in their settings.xml or maven system properties:

        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>javaFX</artifactId>
            <version>2.2</version>
            <scope>system</scope>
            <systemPath>C:\Program Files\Java\jre7\lib\jfxrt.jar</systemPath>
        </dependency>
    

    see Maven project with JavaFX (with jar file in `lib`) for more details as to why

    0 讨论(0)
提交回复
热议问题