January 2018
Intermediate to advanced
434 pages
14h 1m
English
To make self-executable JARs, we need a manifest file called MANIFEST.MF in the META-INF directory. For our purposes here, we just need to specify the name of the Java class that contains the Java-based extractor program's main() method.
One might argue that even though we don’t have top-level class declaration, we are specifying it as HelloWorldKt in the code for the jar task:
manifest { attributes 'Main-Class': 'HelloWorldKt' }
The reason for putting the preceding code block in the jar task is that Kotlin compiler adds all top-level functions to respective classes for back-compatibility with JVM. So, the class generated by Kotlin compiler will have the filename, plus the Kt suffix, which makes it HelloWorldKt.
Also, the ...
Read now
Unlock full access