https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

capitalthree

06/08/2019, 11:51 AM
I'm using a gradle multiplatform project as per the new project wizard's kotlin-jvm and kotlin-js sample webapp. I've added the jOOQ gradle plugin, and I had to add the java plugin alongside the kotlin-multiplatform plugin to get that to work (which could be the issue). I have the jOOQ plugin successfully running its code generator, but it outputs java files instead of kotlin, and I am getting NoClassDefFoundError at runtime with classes that are from java code in my kotlin source tree. What am I doing (most) wrong?
d

Dominaezzz

06/08/2019, 11:52 AM
Kotlin/JVM doesn't support java src code yet.
This feature is in the next version of kotlin-multiplatform.
1.3.40
.
c

capitalthree

06/08/2019, 11:53 AM
ok, should I be using a java source set? how can I make a kotlin source set depend on a java source set properly?
d

Dominaezzz

06/08/2019, 11:53 AM
You can try using the current eap version
1.3.40-eap-67
.
c

capitalthree

06/08/2019, 11:54 AM
thanks!
c

capitalthree

06/08/2019, 12:31 PM
so I've upgraded kotlin and the kotlin-mutiplatform plugins to that version, I am able to use withJava() in jvm(), and that causes jvmMain/java to become a source root, and the compile is happy with java sources going there, but it still gives the same missing class error at runtime
I think it's the classpath in the run configuration
d

Dico

06/08/2019, 12:41 PM
I recommend having a separate jvm only project and depending on it
1
i

ian.shaun.thomas

06/08/2019, 1:55 PM
^ except you can do it as multiple modules in the same project most likely (granted I'm not familiar with the plug-in in question.
c

capitalthree

06/08/2019, 2:00 PM
sorry, I should follow up, I finally got all the stuff working. I had to do additional things to make it actually run the java compile task, and to use the resulting output directory, but I'm sorted
thanks everybody!