DEV Community

Discussion on: Kotlin scripts with JAR dependencies

Collapse
 
nfrankel profile image
Nicolas Frankel

Yes, it is possible.

First, install the official Kotlin Scripting environment through SDK Man.

Then, just add the @file:DependsOn directive in the .kts script file e.g.:

@file:DependsOn("org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.11")
Enter fullscreen mode Exit fullscreen mode

Done

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

How do I install with SDK Man?

Thanks that it is an official support as well, though I don't know how well it would integrate with IntelliJ.

Kotlin support in VSCode is horrible. Seems to be only syntax highlighting.

Collapse
 
nfrankel profile image
Nicolas Frankel

How do I install with SDK Man?

sdk install kotlin

cf. kotlinlang.org/docs/tutorials/comm...

I don't know how well it would integrate with IntelliJ.

You've got everything that you've in regular Kotlin projects