Hi Gunnar,
all module metadata, the main-class but also the version, the os etc, are 
injected by the jar command.

In 8, the MainClass (or all of metadata that are in the manifest) only exist 
from the runtime point of view after being put inside of a jar, so in order to 
be the less disruptive possible for the existing build processes, we have 
chosen to keep the same strategy. This also allow us to support application 
that are built by compiling the code once and split the generated classes in 
several jars afterwards.

cheers,
Rémi

----- Mail original -----
> De: "Gunnar Morling" <[email protected]>
> À: "jigsaw-dev" <[email protected]>
> Envoyé: Mercredi 22 Février 2017 23:44:59
> Objet: Why can't main class be given in module-info.java?

> Hi,
> 
> Why is it that the binary form of module declarations can carry
> information on a main class ("ModuleMainClass" attribute), but no main
> class can be specified in module-info.java?
> 
> It seems setting ModuleMainClass is left to the jar tool, but I'd like
> to understand the rationale behind it.
> 
> Thanks,
> 
> --Gunnar

Reply via email to