cbeust / kobalt

A Kotlin-based build system for the JVM.
Apache License 2.0
432 stars 60 forks source link

Fixed finding tools.jar under Windows when JAVA_HOME is set to JRE. #461

Closed ethauvin closed 6 years ago

ethauvin commented 6 years ago

The problem was that getting javaHome always return the value of _javaHome, so trying to set it is useless:

    override var javaHome: File? = null
        get() = _javaHome!!

To test with the previous version, simply set your JAVA_HOME to a JRE instead of JDK location. Tools.jar will not be found. For example:

export JAVA_HOME="C:\Program Files\Java\jre1.8.0_151"