I'm using a gradle multiplatform project as per th...
# multiplatform
c
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
Kotlin/JVM doesn't support java src code yet.
This feature is in the next version of kotlin-multiplatform.
1.3.40
.
c
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
You can try using the current eap version
1.3.40-eap-67
.
c
thanks!
c
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
I recommend having a separate jvm only project and depending on it
1
i
^ 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
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!