尝试使用Gradle构建时找不到JavaFX软件包

时间:2018-10-25 08:57:57

标签: java gradle javafx

我目前正在尝试使用gradle为我的项目构建一个jar文件,但是遇到了在编译过程中找不到JavaFX软件包的问题。

这是我尝试运行./gradlew clean shadowJar时遇到的一些错误:

/Users/jamesyaputra/Workspace/CS2113T/main/src/main/java/seedu/address/ui/StatusBarFooter.java:15: error: package javafx.scene.layout does not exist
import javafx.scene.layout.Region;

/Users/jamesyaputra/Workspace/CS2113T/main/src/main/java/seedu/address/ui/StatusBarFooter.java:22: error: cannot find symbol
public class StatusBarFooter extends UiPart<Region> {

  symbol: class Region
/Users/jamesyaputra/Workspace/CS2113T/main/src/main/java/seedu/address/ui/ResultDisplay.java:7: error: package javafx.application does not exist
import javafx.application.Platform;

/Users/jamesyaputra/Workspace/CS2113T/main/src/main/java/seedu/address/ui/ResultDisplay.java:8: error: package javafx.beans.property does not exist
import javafx.beans.property.SimpleStringProperty;

/Users/jamesyaputra/Workspace/CS2113T/main/src/main/java/seedu/address/ui/ResultDisplay.java:9: error: package javafx.beans.property does not exist
import javafx.beans.property.StringProperty;

/Users/jamesyaputra/Workspace/CS2113T/main/src/main/java/seedu/address/ui/ResultDisplay.java:10: error: package javafx.fxml does not exist
import javafx.fxml.FXML;

/Users/jamesyaputra/Workspace/CS2113T/main/src/main/java/seedu/address/ui/ResultDisplay.java:11: error: package javafx.scene.control does not exist
import javafx.scene.control.TextArea;

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
100 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* 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.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
1 actionable task: 1 executed

但是,我的IDE仍然能够编译代码而没有任何类型的错误。我尝试重新安装Java并更新了JAVA_HOME路径,但似乎都无法解决问题。 有什么我想念的吗?预先感谢您的帮助。

0 个答案:

没有答案