JohnLCaron / cdm-kotlin

2 stars 1 forks source link

Upgrade to Java 20 FFM #84

Open JohnLCaron opened 1 year ago

JohnLCaron commented 1 year ago

Need kotlin 1.8.20 Need Gradle 1.8 Need IntelliJ 2023.1

JohnLCaron commented 1 year ago

=== IntelliJ

The version of IntelliJ is controlled by user download. Currently I have

IntelliJ IDEA 2023.1 (Ultimate Edition) Build #IU-231.8109.175, built on March 28, 2023 Licensed to John Caron Subscription is active until August 24, 2023. Runtime version: 17.0.6+10-b829.5 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.19.0-35-generic GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 48 Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true

Kotlin: 231-1.8.20-IJ8109.175 Current Desktop: ubuntu:GNOME

=== Gradle The version of gradle is set in gradle/wrapper/gradle-wrapper.properties. To check, run "./gradlew --version" ./gradlew wrapper --gradle-version 8.1

gradle-wrapper.properties: distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip

"Gradle 8.1 now supports using Java 20 for compiling, testing, and starting other Java programs. This can be accomplished by configuring your build or task to use a Java 20 toolchain. https://docs.gradle.org/8.1/userguide/toolchains.html

You cannot currently run Gradle on Java 20 because Kotlin lacks support for JDK 20. However, you can expect support for running Gradle with Java 20 in a future version"

Gradle 8.1 RC1: Maven publication reports "Invalid publication 'mavenJava': artifact file does not exist"

=== Kotlin Kotlin 1.8.20 release 4/3/23 doesnt say what java bytecode level it supports. supports IntelliJ 2022.2.x, 2022.3.x, 2023.1.x

The kotlin version is set all over the place in build.gradle.kts and settings.gradle.kts (this should be centralized, FIXED see PR#259)

next update : June 2023 (1.9 or 2.0?) Kotlin 2.0 will have new front end, "K2". Will have a new IDE plugin

=== Java version

By default, the Kotlin/JVM compiler produces Java 8 compatible bytecode.

Starting with version 1.8.0, the compiler can generate classes with a bytecode version corresponding to JVM 19. One must set the target Java version (there could be some efficiencies to do so), in egklib/build.gradle.kts:

kotlin { jvm { compilations.all { kotlinOptions.jvmTarget = "1.8" } // withJava() ....

JohnLCaron commented 1 year ago

https://stackoverflow.com/questions/76045235/cant-use-jep-434-foreign-function-memory-api-second-preview-from-kotlin