saker.jar Documentation TaskDoc JavaDoc Packages
  1. saker.jar
  2. Examples
  3. Specifying main class

Specifying main class

See also: Manifest

You can specify the main class of your JAR file in two ways. Via the Main-Class manifest attribute, and using the module-info of the archive:

saker.jar.create(
	Manifest: {
		MainAttributes: {
			Main-Class: example.Main
		}
	},
	ModuleInfoMainClass: example.Main
)

We recommend specifying both, so you'll have the main class defined independent whether you're using modules or not. If you don't use modules, the ModuleInfoMainClass parameter will have no effect.