Is there a solid step by step guide on how to solv...
# announcements
p
Is there a solid step by step guide on how to solve this build error?
Copy code
Runtime JAR files in the classpath should have the same version.
For the life of me I can't find what's pulling in the wrong version of stdlib.
e
try running the gradle "dependencies" task on your project and find where the two versions come from
p
I am using Maven and yeah running
dependency:analyze
did not really help me. It just says that the dependency is undeclared but somehow it's there.
e
running
dependency:tree
?
p
no, running
dependency:analyze
but I will try
tree
found it, thanks!
the next question is, how do I get rid of it.. I need the dependency but it's pulling in an old version of kotlin
is there another option than adding
<exclusion>
?
i thought if I declare it specifically in my module it should take precedence over this.. well I declared it in the parent of this pom, but that should work too I thought
Fixed it! I had
stdlib-jre8
declared explicitely but I also had to declare
stdlib
. Now someone could explain to me how Kotlin is packaged and what does it mean to use
stdlib-jre8
vs
stdlib
d
I believe stdlib-jre8 is compiled with bytecode targeting Java 8 rather than Java 6.
i
kotlin-stdlib-jre8
is an additional artifact for
kotlin-stdlib
with java 8 specific API. You need to have both in runtime if you want to use
kotlin-stdlib-jre8
. Usually
kotlin-stdlib
and
kotlin-stdlib-jre7
are pulled in as transitive dependencies of
kotlin-stdlib-jre8
d
Thanks for clarifying 🙂