diff --git a/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml b/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml
index ade15abb1..05ba721bf 100644
--- a/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml
+++ b/camel-k-loader-kotlin/camel-k-loader-kotlin/pom.xml
@@ -130,7 +130,7 @@
kotlin-maven-plugin
${kotlin.version}
- ${maven.compiler.target}
+ ${maven.compiler.release}
@@ -139,7 +139,7 @@
compile
- ${kotlin.compiler.target}
+ ${maven.compiler.release}
src/main/kotlin
@@ -151,7 +151,7 @@
test-compile
- ${kotlin.compiler.target}
+ ${maven.compiler.release}
src/test/kotlin
diff --git a/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt b/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt
index c1b53a83a..e1c12ea7d 100644
--- a/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt
+++ b/camel-k-loader-kotlin/camel-k-loader-kotlin/src/main/kotlin/org/apache/camel/k/loader/kotlin/KotlinCompilationConfiguration.kt
@@ -30,9 +30,16 @@ class KotlinCompilationConfiguration : ScriptCompilationConfiguration(
jvm {
//
// The Kotlin script compiler does not inherit
- // the classpath by default
+ // the classpath by default.
//
dependenciesFromClassloader(wholeClasspath = true)
+
+ //
+ // Scripts have to be compiled with the same
+ // jvm target level as the loader.
+ //
+ compilerOptions.append("-jvm-target")
+ compilerOptions.append("11")
}
ide {
acceptedLocations(ScriptAcceptedLocation.Everywhere)
diff --git a/pom.xml b/pom.xml
index e8793a962..3408cb980 100644
--- a/pom.xml
+++ b/pom.xml
@@ -37,7 +37,6 @@
11
11
11
- 1.8
3.4.0
1.0.0-CR3