Is there a trick to get scratch files working in I...
# intellij
r
Is there a trick to get scratch files working in IntelliJ using the classpath a Kotlin multiplatform module? My scratch file is set to
Use classpath of module [myapp.mysharedmodule.main]
in the toolbar. My shared module has been built, and has commonMain/androidMain/jvmMain source sets. Trying to
import org.myapp.mysharedmodule.Foo
results in
Exception in thread "main" java.lang.NoClassDefFoundError: com/myapp/mysharedmodule/Foo
Any ideas?
Running via the "Run Current File" button/run configuration gives a different error:
Copy code
scratch.kts:1:8: error: unresolved reference: org
import org.myapp.mysharedmodule.Foo
       ^
Ended up getting this working by changing the module to my jvm module rather than common.