RFR 8170289: Re-examine entry point support in jlink

Mandy Chung mandy.chung at oracle.com
Fri Dec 16 19:03:12 UTC 2016

> On Dec 16, 2016, at 8:36 AM, Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com> wrote:
> Hi,
> Please review http://cr.openjdk.java.net/~sundar/8170289/webrev.01/ for https://bugs.openjdk.java.net/browse/JDK-8170289

 273             Optional<String> mainClass = ModuleDescriptor.read(stream).mainClass();
 274             if (mainClass.isPresent()) {
 275                 mainClassName = mainClass.get();
 276             }

This should set mainClassName only if the main class is not specified
in the -—launcher option.  One may want to create launchers for 
multiple entry points.

I think it should validate if the main class is present in the image.
If not found, it should output an error.

Something to be considered in a future release - the existing implementation
creates the launcher scripts as a special case in DefaultImageBuilder.
It seems cleaner to keep DefaultImageBuilder just for the image creation,
i.e. simply write out entries of the ResourcePool to the image.  
The launchers could be added to the ResourcePool entries to the 
corresponding module by one builtin plugin implementation.

For this issue, keeping the change to minimal is good.


More information about the jigsaw-dev mailing list