why does running jars from the command line with kotlin not include the standard java libraries?
c
why does running jars from the command line with kotlin not include the standard java libraries?
c
Normal jars don't bundle their dependencies with them (so you can install them separately if you have a package system). You can either use gradle's
distZip
task to get a ZIP with properly configured classpath, or if you really want a single JAR you can use a Uber-Jar generator (for example the ShadowJar Gradle plugin)
👍 1
ł
I suggest you use ShadowJar
s
@Łukasz Bednarczyk what's the difference . I am using distZip task for now. Is there any performance hit using this method ?
ł
@subashz to be honest, I always use ShadowJar, and I have never got any problem.
👍 1
s
Yeah, found some interesting article after thinking about it. https://devsday.ru/blog/details/50822
c
@subashz distZip/distTar gives you a run script as well, while ShadowJar expects you to run it with
java -jar
. If you're sending it to an end user, it's probably easier/more native to use those.
ł
@CLOVIS ok, but in backend app it isn’t so important