Peter
03/04/2023, 8:06 PM-include-runtime
if some native Kotlin library calls from Console
are involved.Vampire
03/04/2023, 8:22 PM-cp target\kotlin\classes
you only add your own classes to the classpath, but you also have to add all dependencies you use to the classpath for them to be found, including the Kotlin runtime.
The -include-runtime
flag of kotlinc
would indeed build a bad-practice fat-jar with the Kotlin runtime included, so if you don't have other dependencies it would work.
If you would use Gradle, I'd recommend to use the application
plugin to build a proper distribution instead with all your dependencies, your classes, and generated start scripts for Windows and *nix to run the application.
With Maven (assuming you use it due to "target/"), you can achieve something similar with a combination of the appassembler
plugin and the assembly
plugin and a bunch of configuration what is a three-liner in Gradle.Peter
03/04/2023, 8:25 PMPeter
03/04/2023, 8:26 PM