Improve a reported message if -jdk-home path does not exist.

Fix KT-18794
This commit is contained in:
Vladimir Koshelev
2017-07-02 03:22:23 +03:00
committed by Alexander Udalov
parent 994b6d687c
commit 61e52f0bfe
4 changed files with 17 additions and 0 deletions
@@ -407,6 +407,10 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
val (jdkHome, classesRoots) = if (arguments.jdkHome != null) {
val jdkHome = File(arguments.jdkHome)
if (!jdkHome.exists()) {
messageCollector.report(ERROR, "JDK home directory does not exist: $jdkHome")
return COMPILATION_ERROR
}
messageCollector.report(LOGGING, "Using JDK home directory $jdkHome")
jdkHome to PathUtil.getJdkClassesRoots(jdkHome)
}