I';我使用javafxgradle插件,我的构建失败了;不能';找不到Ant JavaFX库;。如何指定JavaFX位置?

I';我使用javafxgradle插件,我的构建失败了;不能';找不到Ant JavaFX库;。如何指定JavaFX位置?,gradle,javafx,java-10,openjfx,javafx-gradle-plugin,Gradle,Javafx,Java 10,Openjfx,Javafx Gradle Plugin,我确实安装了openjfx(通过dnf),我相信它正在寻找的jar就是安装在以下路径的jar: /usr/lib/jvm/openjfx/lib/ant-javafx.jar 显然,我希望避免像那样硬编码jar路径,但我甚至还没有找到使用该路径的方法。下面是渐变输出: $ gradle tasks FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root p

我确实安装了openjfx(通过dnf),我相信它正在寻找的jar就是安装在以下路径的jar:

/usr/lib/jvm/openjfx/lib/ant-javafx.jar
显然,我希望避免像那样硬编码jar路径,但我甚至还没有找到使用该路径的方法。下面是渐变输出:

$ gradle tasks

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'testproj'.
> Couldn't find Ant-JavaFX-library, please make sure you've installed some JDK which includes JavaFX (e.g. OracleJDK or OpenJDK and OpenJFX), and JAVA_HOME is set properly.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 0s
gradle--version

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/travis/opt/gradle/4.9/lib/groovy-all-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

------------------------------------------------------------
Gradle 4.9
------------------------------------------------------------

Build time:   2018-07-16 08:14:03 UTC
Revision:     efcf8c1cf533b03c70f394f270f46a174c738efc

Kotlin DSL:   0.18.4
Kotlin:       1.2.41
Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          10.0.2 ("Oracle Corporation" 10.0.2+13)
OS:           Linux 4.18.9-200.fc28.x86_64 amd64

似乎没有一个好的答案,只是暂时坚持使用Java8

正如在评论中提到的,一个新的Gradle插件可能会在某个时候取代这个插件,但作者希望“请在插件当前状态下生活,只要你能”。这似乎意味着被困在类路径上JavaFX附带的旧版本的Java上

另外,考虑到新的java依赖DAG系统,维护插件的问题可能与打包有关;8是使用旧类路径系统的最后一个版本


我很高兴能找到更好的答案。

FYI,这个插件的作者说,截至2018年4月,当前版本正在退役(他不再工作了),并且他正在私下研究一个新版本,没有明确的预期发布日期。有关详细信息,请参见github.com/FibreFoX/javafx-gradle-plugin/issues/119。目前,没有关于JDK 9新插件的新闻+