I'm migrating an old Java(Maven) project to Java 11. I've changed the pom.xml
to support Java 11 (maven compiler plugin with <release>11<release>
) and executed mvn clean compile
to see whether the code compiles.. but it fails on a line which refers ssl provider from com.sun.net
package
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider())
The compilation error message is as follows
[ERROR] /D:/Workspace/sampler/src/com/sampler/test/cloudtest/CloudTest.java:[32,70] package com.sun.net.ssl.internal.ssl is not visible (package com.sun.net.ssl.internal.ssl is declared in module java.base, which does not export it)
Please help me to resolve this by providing proper ssl provider in Java11.