https://kotlinlang.org logo
Title
l

liamd

07/03/2017, 6:21 PM
so do i need to set
mainClassName
@gildor
s

suresh

07/03/2017, 7:38 PM
liamd: as mentioned earlier, only if you want to create an executable jar.
g

gildor

07/03/2017, 11:38 PM
Actually, even with mainClassName jar will not be executable, Gradle will generate script to run jar + dependencies. Because to create real executable jar (
java -jar your.jar
) you should pack all your dependencies in a single jar with you code (you can do that using shadowJar plugin).
@liamd So you need mainClassName if you want to have task "run" in your Gradle to run Main method of specific class (entry point of your program). Also it allows to generate application distribution from your project that could be installed on your OS
s

suresh

07/04/2017, 1:28 PM
@gildor thanks.. yeah i forgot that application shell script being generated instead of creating uber fat jar.