mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Make sure JAVA_HOME points to the JDK and not the JRE.
Should fix https://github.com/cbeust/kobalt/issues/428.
This commit is contained in:
parent
0f658cf010
commit
ec7d24a6f8
1 changed files with 10 additions and 4 deletions
|
@ -2,10 +2,16 @@ package com.beust.kobalt
|
||||||
|
|
||||||
class SystemProperties {
|
class SystemProperties {
|
||||||
companion object {
|
companion object {
|
||||||
val javaBase =
|
val javaBase : String
|
||||||
System.getenv("JAVA_HOME")
|
get() {
|
||||||
|
val jh = System.getenv("JAVA_HOME")
|
||||||
?: System.getProperty("java.home")
|
?: System.getProperty("java.home")
|
||||||
?: throw IllegalArgumentException("JAVA_HOME not defined")
|
?: throw IllegalArgumentException("JAVA_HOME not defined")
|
||||||
|
val result =
|
||||||
|
if (jh.toLowerCase().endsWith("jre")) jh.substring(0, jh.length - 4)
|
||||||
|
else jh
|
||||||
|
return result
|
||||||
|
}
|
||||||
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")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue