Deprecated Messages Doesn't Disappear After Setting JVM Target


#1

With a Kotlin 1.1 (Gradle) project there are some deprecated messages that keep on appearing even though the JVM target is set to 1.8. See messages like the following: Call to static methods in Java interfaces are deprecated in JVM target 1.6. Recompile with … . Have the following in the build.gradle file to set the JVM target:

compileKotlin {
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

Below is some code which causes the deprecated messages to appear:

val router = Router.router(vertx)
// ...

router.route("/public/*").handler(StaticHandler.create("public"))
router.route("/").handler({ routingCtx ->
    val resp = routingCtx.response()

    resp.statusCode = Status.OK.num
    resp.putHeader("content-type", ContentType.HTML.txt).end(createHomePage())
})

Does the upcoming Kotlin 1.1 update fix this?


#2

Me too! I am also getting:
Kotlin: Calls to static methods in Java interfaces are deprecated in JVM target 1.6. Recompile with '-jvm-target 1.8'

In my Maven properties I have:

<kotlin.version>1.1.0</kotlin.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>

And when I compile from the command line (mvn clean package) I get no warnings (works perfectly). But when I compile from inside IntelliJ IDEA I get the above warning. Here are my Kotlin compiler plugin settings. Neither the Target JVM Version of 1.8 nor the -jvm-target 1.8 additional command line parameter seem to have any effect:

IntelliJ IDEA 2016.3.5
Build #IU-163.13906.18, built on March 6, 2017
JRE: 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13 amd64
JVM: OpenJDK 64-Bit Server VM by Oracle Corporation


#3

I have the same. Reported an issue: https://youtrack.jetbrains.com/issue/KT-17492