i`m trying to use ```<java.version>11</ja...
# spring
f
i`m trying to use
Copy code
<java.version>11</java.version>
with kotlin. But I get this error:
>> Error: Kotlin: Unknown JVM target version: 11
Supported versions: 1.6, 1.8
r
Kotlin don't support java 11 compiled classes
you need to change your java version on maven. You can run in java 11, but can't compile to java 11 as target version
f
so, source can be 11 but target must be 1.8 ?
Copy code
<properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <kotlin.version>1.2.70</kotlin.version>
    </properties>
it compiles and executes, i only get this error now:
>> Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlType
c
because thats not part of jdk11
f
but who uses that? if its the spring boot, shouldn`t it add the dependence?
r
spring boot with kotlin only supports java 8, I guess
n
@fabricio if you want to make your life easier, just install a jdk 8 and run with it
👍 1
r
Currently I'm working in a spring boot kotlin project with jdk 8, and like @nfrankel said will be better if you run your project with jdk 8.
👍 1
c
jax-bind is used by some transitive dep (which does not care which JDK it's on and that 11th does not have it bundled), so boot does not explicitly depend on it. Kotlin and JDK 11 are supported by Spring boot 2.1 / Spring 5.1
t
you need to add a couple of dependencies
Copy code
<!-- JAXB libraries, removed since Jigsaw -->
		<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.activation</groupId>
			<artifactId>activation</artifactId>
			<version>1.1.1</version>
		</dependency>
👍 1