Somewhere in your project CadastroDeProdutos
there should be this:
import sun.misc.BASE64Encoder;
For example, let's compile this class below:
import sun.misc.BASE64Encoder;
public class Teste {}
When doing this, the Java compiler up to version 8 immediately gives you a warning :
Teste.java:1: warning: BASE64Encoder is internal proprietary API and may be removed in a future release
import sun.misc.BASE64Encoder;
^
Translating:
BASE64Encoder is an internal proprietary API and can be removed in a future release
This warning should not be ignored. Classes beginning with sun.
are internal to JDK and should not NEVER be used directly. For this reason, there is no guarantee as to their stability or availability. Any project that uses them runs the risk of not being portable.
In other words, in fact, your project has always been wrong from the beginning because it uses a class that should never have been used and compiled thanks to a language architecture failure.
The warning states that this class could be removed in a future version, and behold, one day that future version arrived! From Java 9, the proper mechanisms to hide classes that should not be visible were added as part of the modules concept. However, the sun.misc.BASE64Encoder
class was not just hidden. It has in fact been completely removed from within JDK.
However, there is a simple solution to this problem. As of Java 8, the class java.util.Base64.Encoder
was added. Therefore, there is no longer any use of sun.misc.BASE64Encoder
. However, the APIs of the two classes have some differences, although there should be nothing too difficult to migrate.
It may even be that you are using an XPTO library from any third party and that this library is using sun.misc.BASE64Encoder
. In this case the situation is a little more complicated, because there is the library that is wrong. This kind of situation created some fuss and a lot of people found it bad because of these unexpected failures. But then, we return to what the warning reports, that these classes should not be used directly, and therefore, it is the bad luck of who did it or trusted the library of someone who did it.
Moral of the story: Never use any class that starts with sun.
. No wonder they have a very big warning saying they should not be used.