Somewhere in your project CadastroDeProdutos
there must be this:
import sun.misc.BASE64Encoder;
For example, let’s compile this class below:
import sun.misc.BASE64Encoder;
public class Teste {}
By 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 a proprietary internal API and can be removed in a future version
This warning should not be ignored. Classes starting with sun.
are internal to the JDK and should not NEVER be used directly. Therefore, there is no guarantee as to their stability or availability. Any project that uses them runs the risk of not being portable.
That is, in fact his project was always wrong from the beginning due to the fact that he used a class that should never have been used and compiled thanks to a flaw in the architecture of the language.
The warning states that this class could be removed in a future version, and behold, one day this future version has arrived! Starting with Java 9, the appropriate mechanisms to hide classes that should not be visible were added as part of the module concept. However, the class sun.misc.BASE64Encoder
not only was it hidden. It was in fact completely removed from inside the JDK.
However, there is a simple solution to this problem. From Java 8, the class java.util.Base64.Encoder
added. So, there’s no more use for sun.misc.BASE64Encoder
. However, the Apis of the two classes have some differences, although there shouldn’t be anything too difficult to migrate.
It may even be that you are using any third-party XPTO library and that this library is using the sun.misc.BASE64Encoder
. In that case the situation is a little more complicated, because that is the wrong library. This kind of situation generated some commotion and many 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, bad luck is of those who made 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 big warning that they should not be used.
Which version of the eclipse you are running?
– Victor Stafusa
https://android.googlesource.com/platform/tools/base/+/master/sdklib/src/main/java/com/android/sdklib/internal/build/SignedJarBuilder.java#177
– Victor Stafusa
https://stackoverflow.com/q/47216694/540552
– Victor Stafusa
I’m using Eclipse Oxygen and I had found this topic before asking this question, and I couldn’t understand almost anything, so I asked this question
– Marcos Paulo S. Rezende
And as for the link, what should I do with it?
– Marcos Paulo S. Rezende
If you install Eclipse Photon, it works?
– Victor Stafusa
I’ve never used this version, but I’ll try
– Marcos Paulo S. Rezende
I’m not saying it’s to do something about the link. I’m just pointing out things that I thought are relevant even to help other people who see your question might perhaps answer it.
– Victor Stafusa
@Victorstafusa I just installed Eclipse Photon and installed the ADT Plugin but still gives the same error. =(
– Marcos Paulo S. Rezende
@Carlosheuberger put the link above.
– Marcos Paulo S. Rezende