magik
magik copied to clipboard
Jvm version incompatibility
Description
I'm not sure if this is caused by magik directly, but I can't get this to work and I'd really like some help. I have no issues with publishing btw, it's only the usage of the jars that I've published.
I'm having a strange issue with the published jar's jvm version. I've set it to 21 literally everywhere, I don't even have jdk 23 installed on my machine, but when I try to use jar as a dependency on another project (which also uses jdk 21) I get an error from gradle telling me it's built for jdk 23 and I should find a version of that dependency built for jdk 21.
This doesn't happen with the local maven repo. I've tried uploading the files manually from the local maven and the issue still happens. I'm using intellij, and here's the things I tried:
- Setting the version of gradle from
Build, Execution, Deployment > Build Tools > Gradleto the project sdk/21. - Setting the project's sdk to 21 (from the menu that opens via ctrl+alt+shift+s, I don't know its name.)
- Setting the
sourceCompatibilityandtargetCompatibilityfrom gradle'sjavablock to 21, or directly setting toolchain to 21 of adoptium - Setting jvmToolchain (again) from
kotlin.jvmToolchainto 21 of adoptium - Setting the
options.releaseoftasks.withType<JavaCompile>()to 21 - Setting the
compilerOptions.jvmTargetoftasks.withType<KotlinCompile>()to 21 - I've even tried checking the compiled class files' version and intellij says its major version is 65 (which is jdk 21)
I have no idea what else I can do. Here are the links, with some git history deleted:
This is using the first method mentioned in magik's readme, btw.
sorry for the late replay
could look under build/lib inside the built jar(s), like this
public interface me.rime.symbols.init.AutoInit extends java.lang.annotation.Annotation
minor version: 0
major version: 65
It's still 65, but when trying to use the dependency from github it's still giving me the same error:
Dependency resolution is looking for a library compatible with JVM runtime version 21, but 'me.rime.symbols:init-annotation:1.0.0' is only compatible with JVM runtime version 23 or newer.
It's not really magik's issue, but I was hoping that maybe you had experience with it. It's fine if you don't, I'll just make do with mavenLocal.