Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile for Java8 by default #144

Merged
merged 3 commits into from
Jul 21, 2023
Merged

Conversation

martinbonnin
Copy link
Contributor

If not, the Kotlin compiler will use the version of the JAVA_HOME jdk.

@benasher44
Copy link
Owner

@martinbonnin this configuration is intentionally omitted. See #31

@martinbonnin
Copy link
Contributor Author

I'm not sure this is the same problem. When bumping Gradle and Kotlin, the bytecode produced depends on the host Java:

mbonnin:~/git/uuid$ java --version  
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment Zulu19.32+13-CA (build 19.0.2+7)
OpenJDK 64-Bit Server VM Zulu19.32+13-CA (build 19.0.2+7, mixed mode, sharing)

mbonnin:~/git/uuid$ ./gradlew jvmJar
[...]
BUILD SUCCESSFUL in 817ms
2 actionable tasks: 2 executed

mbonnin:~/git/uuid$ file build/classes/kotlin/jvm/main/com/benasher44/uuid/UuidHasher.class
build/classes/kotlin/jvm/main/com/benasher44/uuid/UuidHasher.class: compiled Java class data, version 63.0

This fails down the road when trying to use the lib:

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

So maybe it's a KGP thing or maybe it's a Gradle thing but in all cases, it shouldn't hurt to be explicit about Java8?

@benasher44
Copy link
Owner

Ah looks like I missed that Kotlin 1.8.0 dropped support for 1.6. This seems good then. Mind just moving this config to the "intentionally left blank" (replacing it)?

@benasher44 benasher44 merged commit cf1b8ab into benasher44:master Jul 21, 2023
3 checks passed
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.

None yet

2 participants