fun getJavaPath()

in src/main/kotlin/com/compiler/server/executor/JavaExecutor.kt [124:133]


fun getJavaPath(): String {
    // Determine the Java executable path based on the OS
    val javaHome = System.getProperty("java.home") ?: return "java"
    val javaBinPath = if (System.getProperty("os.name")?.lowercase()?.contains("win") == true) {
        Paths.get(javaHome, "bin", "java.exe").toString()
    } else {
        Paths.get(javaHome, "bin", "java").toString()
    }
    return javaBinPath
}