如何为TornadoFx / JavaFx设置gradle

时间:2019-07-01 19:02:11

标签: javafx tornadofx

我正在尝试在IntelliJ ide中创建一个TornadoFx项目。 生成时显示错误

Error: JavaFX runtime components are missing, and are required to run this application

这是build.gradle文件

plugins {
    id 'java'
    id 'org.jetbrains.kotlin.jvm' version '1.3.40'
    id 'org.openjfx.javafxplugin' version '0.0.7'
}
javafx {
    version = "12"
    modules = ['javafx.controls', 'javafx.base', 'javafx.fxml', 'javafx.graphics']
}
group 'tornado1'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    testCompile group: 'junit', name: 'junit', version: '4.12'
    implementation 'no.tornado:tornadofx:1.7.19'
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

以及项目结构中库的屏幕截图 enter image description here

0 个答案:

没有答案