How to check for an internal class in another module from java.base?

Wang Weijun weijun.wang at oracle.com
Tue Nov 1 15:02:41 UTC 2016


HTTP Negotiate uses

  Class.forName("sun.net.www.protocol.http.spnego.NegotiatorImpl", true, null);

to check if the implementation in java.security.jgss module is provided. It looks like this call is throwing a ClassNotFoundException now. Shall I export the package to java.base or is there any other trick? I remember there used to be an addReads method but seems no one is using it now.

Or I must use a service loader?

Thanks
Max



More information about the jigsaw-dev mailing list