Can someone help me. Should I use arrow-core-jvm o...
# arrow
l
Can someone help me. Should I use arrow-core-jvm or arrow-core in an application that will run in jvm. I guess it will be the jvm one, right? If so, can you explain what is the difference?
j
arrow-core is the multiplatform artifact, use that one, you will end up with the JVM one anyway šŸ™‚
l
Thanks Johann. The reason I ask this is because when I use the arrow-core, it throws
java.lang.NotSuchMethod
for the
nonEmptyListOf()
, but if I change to arrow-core-jvm, the error disappears! So I'm trying to figure out why
🤯 1
a
which version of Gradle / Kotlin are you using? in principle newer versions of Kotlin Gradle plug-in should depend on the jvm one in addition to the common one if you are building a JVM app
l
Hi @Alejandro Serrano.Mena! The Gradle version is 8.4. And this the arrow dependecy tree for two kotlin versions and both libs:
Copy code
with kotlin version 1.9.22 and arrow-core-jvm it works:
\--- io.arrow-kt:arrow-core-jvm:1.2.0
     +--- io.arrow-kt:arrow-atomic:1.2.0
     |    \--- io.arrow-kt:arrow-atomic-jvm:1.2.0
     |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 -> 1.9.22
     |              \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
     +--- io.arrow-kt:arrow-continuations:1.2.0
     |    \--- io.arrow-kt:arrow-continuations-jvm:1.2.0
     +--- io.arrow-kt:arrow-annotations:1.2.0
     |    \--- io.arrow-kt:arrow-annotations-jvm:1.2.0
     \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 -> 1.9.22 (*)
 
with kotlin version 1.9.22 and arrow-core doesn't work:
 \--- io.arrow-kt:arrow-core:1.2.0
     +--- io.arrow-kt:arrow-atomic:1.2.0
     |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 -> 1.9.22
     |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*)
     |    \--- org.codehaus.mojo:animal-sniffer-annotations:1.23
     +--- io.arrow-kt:arrow-continuations:1.2.0
     |    +--- org.codehaus.mojo:animal-sniffer-annotations:1.23
     |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 -> 1.9.22 (*)
     +--- io.arrow-kt:arrow-annotations:1.2.0
     |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 -> 1.9.22 (*)
     |    \--- org.codehaus.mojo:animal-sniffer-annotations:1.23
     +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 -> 1.9.22 (*)
     \--- org.codehaus.mojo:animal-sniffer-annotations:1.23
     
with kotlin version 1.8.22 and arrow-core it works:
 \--- io.arrow-kt:arrow-core:1.2.0
     +--- io.arrow-kt:arrow-atomic:1.2.0
     |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
     |    \--- org.codehaus.mojo:animal-sniffer-annotations:1.23
     +--- io.arrow-kt:arrow-continuations:1.2.0
     |    +--- org.codehaus.mojo:animal-sniffer-annotations:1.23
     |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
     +--- io.arrow-kt:arrow-annotations:1.2.0
     |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
     |    \--- org.codehaus.mojo:animal-sniffer-annotations:1.23
     +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22
     \--- org.codehaus.mojo:animal-sniffer-annotations:1.23