【发布时间】:2018-04-03 10:47:49
【问题描述】:
我正在尝试使用 Java 1.8.0_144 构建我的应用程序以解决 an issue that apparently started after that。我运行这个命令来构建:
gradle jfxNative -Dorg.gradle.java.home="c:\Program Files\Java\jdk1.8.0_144"
它会因为这个错误而停止:
Execution failed for task ':jfxNative'.
> Not found MSVC dlls
我在哪里以及如何获得这些 MSVC dll?
完整的输出如下所示:
c:\...\>gradle jfxNative -Dorg.gradle.java.home="c:\Program Files\Java\jdk1.8.0_144"
> Task :jfxNative
The jar lib\lombok-1.16.18.jar has a main class lombok.launch.Main that does not match the declared main tech.dashman.dashman.ConfiguratorApp
The jar lib\jna-4.5.0.jar has a main class com.sun.jna.Native that does not match the declared main tech.dashman.dashman.ConfiguratorApp
The jar lib\javassist-3.22.0-CR2.jar has a main class javassist.CtClass that does not match the declared main tech.dashman.dashman.ConfiguratorApp
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':jfxNative'.
> Not found MSVC dlls
* 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
BUILD FAILED in 8s
5 actionable tasks: 2 executed, 3 up-to-date
我当前的依赖列表如下所示:
dependencies {
compile "tech.dashman:dashmancommon:1.0.0-SNAPSHOT"
compile "org.projectlombok:lombok:1.16.18"
compile "org.springframework:spring-web:5.0.2.RELEASE"
compile "org.springframework.retry:spring-retry:1.2.2.RELEASE"
compile "com.fasterxml.jackson.core:jackson-databind:2.9.3"
compile "org.kordamp.ikonli:ikonli-javafx:2.1.0"
compile "org.kordamp.ikonli:ikonli-fontawesome5-pack:2.1.1"
compile "net.harawata:appdirs:1.0.1"
compile "io.sentry:sentry:1.6.4"
compile "org.javassist:javassist:3.22.0-CR2"
testCompile "junit:junit:4.12"
}
我尝试添加
compile "net.java.dev.jna:jna-platform:4.5.1"
到那个列表,但我在尝试构建安装程序时仍然遇到同样的错误。
将它添加到我的buildscript dependencies 也没有改变错误:
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "de.dynamicfiles.projects.gradle.plugins:javafx-gradle-plugin:8.8.2"
classpath "com.github.ben-manes:gradle-versions-plugin:0.17.0"
classpath "de.dynamicfiles.projects.javafx.bundler:custom-file-extension-windows-bundler:1.0.2-SNAPSHOT"
classpath "net.java.dev.jna:jna-platform:4.5.1"
}
}
【问题讨论】:
-
你在哪里找到 javafx-gradle-plugin 版本 8.8.2 根据releases,最后一个稳定版是 8.8.0。请降级插件版本。
-
通常我从 Maven 中心获取我的库:search.maven.org/…
-
您可能已经确保满足 gradle 插件页面中提到的要求?!由于 javafx gradle 插件似乎只是 javapackager 的包装器,因此您也应该检查此要求。
-
@dpr:对不起,什么要求?
-
插件的github page 提到了一些操作系统特定的要求。它还链接了official documentation of javapackager,其中更详细地解释了要求。例如,需要安装 inno 设置并在路径上可用。
标签: java visual-c++ dll