suresh
07/30/2025, 8:34 PMsettings.jvm
and the settings.java
? I’m a little confused about their clear distinctions and which configuration should go where.joffrey
07/30/2025, 9:02 PMsettings.kotlin
contains settings for the Kotlin compiler, thus only apply to Kotlin sources
• settings.java
contains settings for the Java compiler, thus only apply to Java sources
• settings.jvm
contains settings that apply to both Java and Kotlin sources (some common compiler options, settings related to the JDK in general, to the test JVM, etc.)joffrey
07/30/2025, 9:04 PMsuresh
07/30/2025, 9:20 PMsuresh
07/30/2025, 9:21 PMsuresh
07/30/2025, 9:26 PM00:06.858 ERROR :shared:compileJvm /Users/sgopal1/code/kmp-amper/shared/src@jvm/JVersion.java:3: error: ScopedValue is a preview API and is disabled by default.
00:06.859 ERROR :shared:compileJvm System.out.println(ScopedValue.newInstance());
00:06.859 ERROR :shared:compileJvm ^
00:06.859 ERROR :shared:compileJvm (use --enable-preview to enable preview APIs)
00:06.859 ERROR :shared:compileJvm 1 error
But the same API used in kotlin sources, compiles without any issues. Does kotlin compiler enable jdk preview feature by default ?joffrey
07/30/2025, 9:29 PMsettings.java.freeCompilerArgs
, the support wasn't added yet in the Amper IDEA plugin (the plugin needs to tell the IDE how to configure compilers based on the Amper model). You really live on the edge of the edge here 😄 The release cycle of the IDE is a bit longer, so unfortunately you might have to wait for a bit before getting the latest Amper plugin updates.joffrey
07/30/2025, 9:31 PMsettings.jvm.release
does restrict the available Java APIs even in Kotlin sources, but preview APIs, I don't know.suresh
07/30/2025, 9:33 PM❯ java --version
openjdk 21.0.8 2025-07-15 LTS
OpenJDK Runtime Environment Zulu21.44+17-CA (build 21.0.8+9-LTS)
OpenJDK 64-Bit Server VM Zulu21.44+17-CA (build 21.0.8+9-LTS, mixed mode, sharing)
❯ java -jar ./build/tasks/_jvm_executableJarJvm/jvm-jvm-executable.jar
java.lang.ScopedValue@f0001e1
Hello Kotlin 2.2.0 - JVM World 21.0.8
suresh
07/30/2025, 9:33 PMsuresh
07/30/2025, 9:52 PM00:07.523 ERROR :shared:compileJvm /../code/kmp-amper/shared/src@jvm/JVersion.java:3: warning: [preview] ScopedValue is a preview API and may be removed in a future release.
00:07.525 ERROR :shared:compileJvm System.out.println(ScopedValue.newInstance());
00:07.525 ERROR :shared:compileJvm ^
00:07.540 ERROR :shared:compileJvm 1 warning
joffrey
07/30/2025, 11:01 PMsuresh
07/31/2025, 1:34 AM