Am 06.11.19 um 16:32 schrieb Alan Bateman:
On 06/11/2019 14:01, Michael Paus wrote:

The --suggest-providers option would be more useful if one could limit it to the providers that can actually be used by my code, i.e.
a call like

jlink --add-modules java.base --suggest-providers

should only return the providers which can be reached by java.base. Or did I miss something here?

java.base is a prolific user of services. Many standard and JDK-specific modules provide implementations of services that are used by java.base. Those modules in turn make use of additional services. So it's working as intended. The other form of --suggest-providers allows you to specify the service interface so that you can fine tune the additional providers to add to the run-time image. If you change the above to `--suggest-providers java.security.Provider` then you'll see the list of modules provide implementations of Security. You should see the jdk.crypto.ec module in that list.

-Alan

I still don't see how entries like this

java.desktop provides javax.sound.midi.spi.MidiDeviceProvider used by java.desktop

or this

jdk.jshell provides javax.tools.Tool not used by any observable module

come into play.

In practice a user does not know all service interfaces that are potentially relevant for an application and so cannot search for them. All in all I still think that removing --bind-services
from the default parameters is dangerous and at least justifies a warning.

Just my two €ent


Reply via email to