CLI: use JDK 1.6 to compile the "kotlin" launcher script

"kotlin" is used to run programs compiled by "kotlinc" which supports
emitting JVM bytecode 1.6, so it should also be runnable on JDK 1.6
This commit is contained in:
Alexander Udalov
2017-06-01 00:36:19 +03:00
parent 96bd8cb3c2
commit c851e9d206
3 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
</component>
@@ -77,9 +77,13 @@ class MainClassRunner(override val className: String) : AbstractRunner() {
class JarRunner(private val path: String) : AbstractRunner() {
override val className: String =
try {
JarFile(path).use { jar ->
val jar = JarFile(path)
try {
jar.manifest.mainAttributes.getValue(Attributes.Name.MAIN_CLASS)
}
finally {
jar.close()
}
}
catch (e: IOException) {
throw RunnerException("could not read manifest from " + path + ": " + e.message)