How do I add javafx dependency as a gradle depende...
# announcements
a
How do I add javafx dependency as a gradle dependency? I am having a problem with CI/CD in github actions. In my pc, I can build and test my code coz I have the javafx runtime. However in the testing vm, it appears to be missing. Help please . . .
d
can't simply add the javafx dependency to your gradle file? what's the error you received during the build?
not sure which one you are depending on: https://mvnrepository.com/search?q=javafx
a
Thank you for your quick response. I am getting things like
cannot access javafx.event.EventTarget
I tried adding
org.openjfx:javafx-base:14.0.1
but it ddnt help
Is there a specific repo that I am leaving out?
d
is this compilation error or runtime error?
do you have the full stacktrace?
a
Its a compilation error. Yes, let me give you the full stacktrace
d
hrm... can share the gradle build file?
a
Copy code
plugins {
    id("asoft-lib")
}

android {
    defaultConfig {
        minSdkVersion(9)
    }
}

kotlin.sourceSets {
    val commonMain by getting {
        dependencies {
            implementation(kotlin("stdlib-common"))
            api("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:${versions.kotlinx.coroutines}")
            api(project(":rx"))
            api(project(":io"))
            api(project(":persist"))
            api(project(":platform"))
        }
    }

    val androidMain by getting {
        dependencies {
            implementation(kotlin("stdlib"))
            api("org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlinx.coroutines}")
            api("androidx.lifecycle:lifecycle-extensions:${versions.androidx.lifecycle}")
            api("androidx.fragment:fragment:${versions.androidx.fragment}")
            api("androidx.appcompat:appcompat:${versions.androidx.appcompat}")
            api("com.google.code.gson:gson:${versions.gson}")
        }
    }

    val jvmMain by getting {
        dependencies {
            implementation(kotlin("stdlib"))
            api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinx.coroutines}")
            api("org.openjfx:javafx-base:14.0.1")
            api("no.tornado:tornadofx:${versions.tornadofx}")
        }
    }

    val jsMain by getting {
        dependencies {
            implementation(kotlin("stdlib-js"))
            api("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:${versions.kotlinx.coroutines}")
            api("org.jetbrains.kotlinx:kotlinx-html-js:${versions.kotlinx.html}")
            api("org.jetbrains:kotlin-extensions:${versions.kotlinjs.extensions}")
            api("org.jetbrains:kotlin-react:${versions.kotlinjs.react}")
            api("org.jetbrains:kotlin-react-dom:${versions.kotlinjs.reactDom}")
            api("org.jetbrains:kotlin-styled:${versions.kotlinjs.styled}")
            api("org.jetbrains:kotlin-css-js:${versions.kotlinjs.css}")
            api("org.jetbrains:kotlin-react-router-dom:${versions.kotlinjs.reactRouterDom}")
        }
    }
}
d
looks ok... maybe you can try download the javax jar file for linux and put into your JVM ext library folder....
a
I tried installing javafx jar in the virtual machine, It ddn't work. Lemme keep looking