Kotlin/kotlin-spark-api

for JVM target 1.8

emesday opened this issue · 3 comments

My existing Scala Spark (using sbt) project which compiled with -source 1.8 -target 1.8 shows

Kotlin: Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option

Should I rebuild this project with 8 (which replaces 11 below)

const val jvmTarget = "11"


I tried:

libraryDependencies ++= Seq(
  "org.jetbrains.kotlin" % "kotlin-stdlib" % "1.7.22",
  "org.jetbrains.kotlinx.spark" % "kotlin-spark-api_3.1.2_2.12" % "1.2.2"
)

and the kotlin code was

fun main() {
    println("hello")
    withSpark {
        dsOf(1, 2, 3).show()
    }
}

.

without withSpark block, it works and shows

hello

Copy of #186, #183,
fixed in #189
Already released the fix in the dev version https://github.com/orgs/Kotlin/packages?tab=packages&q=kotlin-spark-api and I´m in the process right now of releasing version 1.2.3 which will have full java 8 support.

It works! Thanks.

I tested with

// in sbt
libraryDependencies ++= Seq("org.jetbrains.kotlinx.spark" % s"kotlin-spark-api_3.1.2_2.12" % "1.2.3")