If you a writing libraries for the JVM, Java is preferred to Kotlin because it does not drag along a standard library dependency.
To be fair there is Kotlin Multiplatform where this is not the case. https://kotlinlang.org/docs/multiplatform.html
It is no different than writing C code across UNIX, Windows, mainframe, microcomputers and embedded, consoles, and somehow work across all of them.
If you a writing libraries for the JVM, Java is preferred to Kotlin because it does not drag along a standard library dependency.
To be fair there is Kotlin Multiplatform where this is not the case. https://kotlinlang.org/docs/multiplatform.html