1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Better JAVA_HOME detection.

This commit is contained in:
Cedric Beust 2017-04-19 08:19:46 -07:00
parent 3686c4e110
commit 1febd47368

View file

@ -2,8 +2,10 @@ package com.beust.kobalt
class SystemProperties { class SystemProperties {
companion object { companion object {
val javaBase = System.getProperty("java.home") ?: val javaBase =
(System.getenv("JAVA_HOME") ?: throw IllegalArgumentException("JAVA_HOME not defined")) System.getenv("JAVA_HOME")
?: System.getProperty("java.home")
?: throw IllegalArgumentException("JAVA_HOME not defined")
val javaVersion = System.getProperty("java.version") val javaVersion = System.getProperty("java.version")
val homeDir = System.getProperty("user.home") val homeDir = System.getProperty("user.home")
val tmpDir = System.getProperty("java.io.tmpdir") val tmpDir = System.getProperty("java.io.tmpdir")