Compiling to native machine code on Ubuntu Linux


Hello, is it possible to compile my Kotlin code to binary instructions and create an executable file on Linux? I tried to compile to *.jar file and than to some “strange” native file *.kexe file. But what if I’d want to compile it to an executable so as not to rely on any Java VM or some Kotlin interpret?

Is it possible to do from Kotlin Compiler or would it be maybe possible to compile it to jar file and than use compiler from Java to binary?


*.kexe is native binary executable file.


Thank you for the answer, I didn’t notice that *.kexe was just a temporary file before compiling to a native code.


It’s not temporary file, it is normal self-contained executable.
You can rename it to anything else if do not like .kexe suffix in name.