[英]Running project with gradle results in finished with non-zero exit value 1
Whenever I try to run my application with the gradle run
command fails its execution with the following error:每当我尝试使用gradle run
命令运行我的应用程序时,它的执行都会失败并显示以下错误:
17:12:58: Executing task ':TicTacToe.main()'...
> Configure project :
Project : => no module-info.java found
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :TicTacToe.main() FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
3 actionable tasks: 1 executed, 2 up-to-date
Fehler: Zum Ausf�hren dieser Anwendung ben�tigte JavaFX-Runtime-Komponenten fehlen
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':TicTacToe.main()'.
> Process 'command 'C:/Program Files/Amazon Corretto/jdk15.0.2_7/bin/java.exe'' finished with non-zero exit value 1
* 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 234ms
One message in particular is confusing me a lot:特别是一条消息让我很困惑:
Fehler: Zum Ausf hren dieser Anwendung ben tigte JavaFX-Runtime-Komponenten fehlen" Fehler: Zum Ausf hren dieser Anwendung ben tigte JavaFX-Runtime-Komponenten fehlen"
Translated: "Error: The application requires missing JavaFX-Runtime-Compontens to execute the applicaction."翻译:“错误:应用程序需要缺少 JavaFX-Runtime-Compontens 才能执行应用程序。”
Isn't my gradle supposed to load missing dependencies?我的 gradle 不应该加载缺少的依赖项吗?
Since I have absolutely no clue why and how my gradle fails I'm seeking for help.由于我完全不知道我的 gradle 为什么以及如何失败,我正在寻求帮助。
For further details, I'll include my build.gradle:有关更多详细信息,我将包含我的 build.gradle:
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.9'
}
group 'tictactoe'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
test {
useJUnitPlatform()
}
javafx {
version = "17"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
application {
mainClass = 'tictactoe.TicTacToe'
}
The main thing in a nutshell – you'll need this openjfx.io You are using Java 14 version.简而言之,最重要的是——你需要这个 openjfx.io 你使用的是 Java 14 版本。 Since 11 version they removed JavaFX and it is available as a separate module.从 11 版本开始,他们删除了 JavaFX,它可以作为一个单独的模块使用。 Accordingly, it is trite in your jar and not.因此,它在你的罐子里是陈腐的,而不是。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.