Java file in a multiplatform library

Hi,

is it also possible, like in a kotlin project, to use java files?

If yes - what is to do, that ide accept the java file?

No, you Kotlin does not compile Java code to any of its target platforms other than the JVM target.

If you must use Java code, you can always just compile to Java bytecode since Java bytecode is already portable. You can also compile Java bytecode to JS or to machine code with some third party compilers–which is a very different thing than how Kotlin multiplatform does it.

1 Like

The only place where you can have java would be in the jvm part of you project, but not in the native, js or commons parts. Have a look at this project: https://github.com/endanke/kotlin-mpp-framework-skeleton

Ok - thanks for the quick responses