尽管添加了JavaFX插件,Gradle项目仍无法找到JavaFX应用程序类
我对Gradle和JavaFX都是新手。我已经将JavaFX插件添加到我的尽管添加了JavaFX插件,Gradle项目仍无法找到JavaFX应用程序类,java,eclipse,gradle,javafx,eclipse-plugin,Java,Eclipse,Gradle,Javafx,Eclipse Plugin,我对Gradle和JavaFX都是新手。我已经将JavaFX插件添加到我的build.gradlefollowing和。但是,我的主类Library.java在尝试扩展JavaFX的应用程序时无法检测到它 build.gradle plugins { // Apply the java-library plugin to add support for Java Library id 'java-library' id 'application' id 'org.
build.gradle
following和。但是,我的主类Library.java
在尝试扩展JavaFX的应用程序时无法检测到它
build.gradle
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:28.0-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
jar {
manifest {
attributes 'Main-Class': 'Chess.Library'
}
}
mainClassName = 'Chess.Library'
图书馆类的屏幕截图
根本没有来自javafx
包的应用程序。我错过了什么
我使用Spring工具套件4.0作为我的IDE,带有Buildship Gradle插件,如果有帮助的话。我也在运行Oracle Java 13
编辑1:
我已经添加了建议的更改,这就是我的build.gradle现在的样子
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:28.0-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
jar {
manifest {
attributes 'Main-Class': 'Chess.Library'
}
}
javafx {
version = "13"
modules = [ 'javafx.controls' ]
}
mainClassName = 'Chess.Library'
但问题仍然存在
我还检查了我的项目和外部依赖项,除了javafx
我自己解决了这个问题,虽然不确定是什么原因造成的,但我的项目的构建路径有一个无限的Java13。修复并重新启动IDE解决了这个问题