0

I have Kotlin project with JAR executable as output. Is it possible to have this final JAR Java only? I mean by that if I can compile Kotlin into pure Java so I do not need to include Kotlin dependencies in my JAR, because they are very big (almost no code = 800kB)

enter image description here

Baterka
  • 3,075
  • 5
  • 31
  • 60
  • What kind of jar are you trying to create? Since this is tagged as shadowjar I would interpret it as you trying to create a fat/uberjar, where you have to include the stdlib for obvious reasons. Also you don't compile kotlin to java, you compile both to java/JVM bytecode. – somethingsomething Nov 17 '21 at 12:39

1 Answers1

1

If by "dependencies" you mean Kotlin stdlib, you can exclude it by setting kotlin.stdlib.default.dependency=false in gradle.properties (Dependency on the standard library). But how do you think Kotlin classes will be resolved at runtime?

Abhijit Sarkar
  • 21,927
  • 20
  • 110
  • 219