Hey guys, I have the following error: ``` ...
# dependency-management
s
Hey guys, I have the following error:
Copy code
- Variant 'runtimeElements' capability org.pkl-lang:pkl-codegen-java:0.26.0-SNAPSHOT declares a runtime of a library, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
Can someone help me to understand this 🙈 I don't get it fully.. What is only compatible with Java 11? And who declares a component that is compatible with Java 17?
✅ 1
t
org.pkl-lang:pkl-codegen-java:0.26.0-SNAPSHOT
only has Java 17 variant, but your build (consumer) wants a Java 11 variant.
☝️ 2
s
Thanks @Thomas Broyer But.. I'm still confused.. 🤔 The full message is like this:
Copy code
> Could not resolve all files for configuration ':pkl-tools:compileClasspath'.
   > Could not resolve project :pkl-codegen-java.
     Required by:
         project :pkl-tools
      > No matching variant of project :pkl-codegen-java was found. The consumer was configured to find an API of a library compatible with Java 11, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
... Stuff And then the message from my original question
Copy code
- Variant 'runtimeElements' capability org.pkl-lang:pkl-codegen-java:0.26.0-SNAPSHOT declares a runtime of a library, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally:
              - Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
It is a multi-module project. Both modules (
pkl-tools
and
pkl-codegen-java
) share (should 😄 ) the same
jvmToolchain
. So the message means that
pkl-tool
wants a Java 11 variant ?!
Okay, nevermind. I found the problem 🚀 🙂
pkl-tool
doesn't used the same
jvmToolchain
🙃
👍 1