Closed jmfayard closed 1 year ago
Hi @jmfayard, thanks for bringing this to my attention.
I will look into this. I may have set the dependencies wrongly.
Hi @jmfayard, I have been investigating but do not have a solution yet.
I was able to recreate the error messages by creating a small application that depends on slf4j-klogging:0.2.2
and attempting to build using Java 8.
I built new versions of klogging-jvm
(0.4.3) and slf4j-klogging
(0.3.0-SNAPSHOT) that compile Kotlin to JVM 8 bytecode but that has not worked.
I will continue investigating and let you know.
Otherwise, if you want to use Klogging, can you use JVM 11 in your project?
@mjstrasser I'm already using JVM 11 as you can see here: https://scans.gradle.com/s/xazqkjpygc6by#infrastructure
AdoptOpenJDK OpenJDK 64-Bit Server VM 11.0.11+9 (mixed mode)
I wonder if this happens because some dependencies like ktor request jvm 8
@jmfayard I think I have solved the issue in version 0.2.4. My sample application now builds correctly on JVM 8 and 17. Let me know if it works for you.
I added explicit Java toolchain declaration to build.gradle.kts
:
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
This caused a change to outgoing variants. The output of ./gradlew outgoingVariants
includes:
--------------------------------------------------
Variant apiElements
--------------------------------------------------
Description = API elements for main.
Capabilities
- io.klogging:slf4j-klogging:0.2.4 (default capability)
Attributes
- org.gradle.category = library
- org.gradle.dependency.bundling = external
- org.gradle.jvm.environment = standard-jvm
- org.gradle.jvm.version = 8
- org.gradle.libraryelements = jar
- org.gradle.usage = java-api
- org.jetbrains.kotlin.platform.type = jvm
Artifacts
- build/libs/slf4j-klogging-0.2.4.jar (artifactType = jar)
Thanks for bringing this to my attention! I had not paid attention to Gradle variants and toolchains before.
Hello, I added to my project
It doesn't resolve
See: https://scans.gradle.com/s/xazqkjpygc6by/dependencies
I get this error if I try to compile