Hi all,
I’m planning to build a library for Dropwizard. Since I’m targeting Dropwizard 5, it makes sense to compile my library with Java 17, as Dropwizard 5 requires Java 17 or newer. However, since I was going to write it in Kotlin, I don’t know what version of Kotlin I should use.
My thinking is this; if someone is creating a Java project, and they use my library, it won’t matter what Kotlin version I’ve used, as the Kotlin code will be compiled down to Java 17 byte code. However, if someone is writing a Kotlin project, and they use my library, if my library is using a newer version of Kotlin than they are, then they won’t be able to use my library.
I looked up what versions of Kotlin were tested with what versions of Java (link here), so I’m thinking Kotlin 1.6 makes sense, as it guarantees compatibility with Java 17. But also, that’s a 5 year old version of Kotlin. Should I be going with a newer version? What about 2.0? That’s from two years ago; hopefully people are using at least 2.0, now? But I know that personally, at my company, we still have a lot of code bases on Kotlin 1.4.20.
I don’t really know what’s the best approach to take, and would love some input as to what people think would make sense, and why.