When creating a multiplatform project, I have .jav...
# multiplatform
When creating a multiplatform project, I have .java files in the jvmMain and jvmTest source sets. However, when building the project these files seem to be ignored and only .kt files get compiled. Is there something special I need to do to get the multiplatform configuration to also compile java files in the jvm* source sets?
target works only with Kotlin source code, similar to
and native targets. There is a deprecated undocumented target called
, which might suit you, bur it's future is vague. The other way might be to separate your Kotlin+Java code into two separate modules,
, but this, of course, will be plausible only if the code is not awfully tangled.
I would recommend you to convert the java files to kotlin ones. I’ve did this before and we can do this on a good way. Maybe you will need to manually check something but I think you’ll need less effort in the long run. Or, you may try to configure a new module not using the multiplatform plugin and then import this in your mpp module like if you’re using an external library.