CLI: report error if kotlinc is invoked on Java 6 or 7

#KT-17297 Fixed
This commit is contained in:
Alexander Udalov
2017-06-01 00:49:46 +03:00
parent ea9194e1fb
commit 2b878f863c
@@ -32,6 +32,13 @@ public class Preloader {
public static final int DEFAULT_CLASS_NUMBER_ESTIMATE = 4096;
public static void main(String[] args) throws Exception {
String javaVersion = System.getProperty("java.specification.version");
if (javaVersion.equals("1.6") || javaVersion.equals("1.7")) {
System.err.println("error: running the Kotlin compiler under Java " + javaVersion + " is not supported. " +
"Java 1.8 or later is required");
System.exit(1);
}
try {
run(args);
}