3

I am migrating Java 1.8 to OpenJDK 11. Getting some dependency errors.

  1. "sun.security.x509" is not visible.
  2. BASE64Encoder error

How can I resolve these? I am using Apache Ant for build.

Gnik
  • 7,120
  • 20
  • 79
  • 129

1 Answers1

0

We can't tell you how to address the first problem since you haven't shown us the code where you are using classes in the sun.security.x509 package. A possible workaround might be to use --add-exports and/or --add-opens as described in this blog post:

However, that work-around is liable to stop working in the future. The solution would be to find a way to avoid depending on those classes.

The second problem can be used by rewriting your code to use the java.util.Base64 class (javadoc) that was introduced in Java 8.


I am using Apache Ant for build.

That is not directly relevant. The root cause of the problem is in the code you are building not the build tool you are using.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216