Skip to content

Conversation

@mpkorstanje
Copy link
Contributor

The jvmTarget defaults 1.8. So without setting the jvmTarget, when using inline fun such as assertDoesNotThrow, the compiler will complain:

Kotlin: Cannot inline bytecode built with JVM target 17 into bytecode
that is being built with JVM target 1.8. Specify proper '-jvm-target'
option.
  1. https://kotlinlang.org/docs/maven.html#attributes-specific-to-jvm

I hereby agree to the terms of the JUnit Contributor License Agreement.

The `jvmTarget` defaults 1.8. So without setting the `jvmTarget`, when
using inline fun such as `assertDoesNotThrow`, the compiler will
complain:

```
Kotlin: Cannot inline bytecode built with JVM target 17 into bytecode
that is being built with JVM target 1.8. Specify proper '-jvm-target'
option.
```

1. https://kotlinlang.org/docs/maven.html#attributes-specific-to-jvm
@mpkorstanje mpkorstanje force-pushed the fix/kotlin-maven-plugin-set-java-target branch from 344cc21 to 8aa7314 Compare November 17, 2025 23:04
@mpkorstanje mpkorstanje merged commit 8752157 into main Nov 18, 2025
3 checks passed
@mpkorstanje mpkorstanje deleted the fix/kotlin-maven-plugin-set-java-target branch November 18, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants