Skip to content

Commit

Permalink
Fixed java executable for build/run in some environments
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Larson committed Jan 15, 2025
1 parent 2a9f2f4 commit 72b1870
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ tasks.register("createRunScript") {
dependsOn("compileJava", "compileKotlin", "processResources")

doLast {
// Get the Java executable from JAVA_HOME environment variable
val javaHome = System.getenv("JAVA_HOME") ?: throw IllegalStateException("JAVA_HOME is not set")
val javaExecutable = "$javaHome/bin/java"
// Use the Java executable that Gradle is using
val javaExecutable = "${System.getProperty("java.home")}/bin/java"

// Collect runtime classpath elements into a single string with path separator
val runtimeClasspath = configurations["runtimeClasspath"].files.joinToString(File.pathSeparator) {
Expand Down

0 comments on commit 72b1870

Please sign in to comment.