且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Javafx项目不能用maven编译

更新时间:2022-05-10 03:15:37

将其置于依赖项中(取决于您的jdk所在的位置)将有助于编译依赖项但是你应该用一个用户可以在settings.xml或maven系统属性中指定的变量替换它:

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>

参见使用JavaFX的Maven项目(在`lib`中使用jar文件),了解更多有关原因的详细信息

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