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

Jvm version incompatibility #8

Open
Emirlol opened this issue Feb 20, 2025 · 2 comments
Open

Jvm version incompatibility #8

Emirlol opened this issue Feb 20, 2025 · 2 comments

Comments

@Emirlol
Copy link

Emirlol commented Feb 20, 2025

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 > Gradle to 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 sourceCompatibility and targetCompatibility from gradle's java block to 21, or directly setting toolchain to 21 of adoptium
  • Setting jvmToolchain (again) from kotlin.jvmToolchain to 21 of adoptium
  • Setting the options.release of tasks.withType<JavaCompile>() to 21
  • Setting the compilerOptions.jvmTarget of tasks.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.

@elect86
Copy link
Collaborator

elect86 commented Mar 6, 2025

sorry for the late replay

could look under build/lib inside the built jar(s), like this

Image

@Emirlol
Copy link
Author

Emirlol commented Mar 6, 2025

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.

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

No branches or pull requests

2 participants