[Yanel-dev] Migrating from Java 8 to Java 9 - Base 64

Michael Wechner michael.wechner at wyona.com
Sun Mar 4 07:12:24 EST 2018


Hi

I noticed that Java 9 on Mac does not provide anymore
sun.misc.BASE64Decoder and that we have to replace it by java.util.Base64

-                sun.misc.BASE64Decoder dec = new sun.misc.BASE64Decoder();
-                String userpassDecoded = new
String(dec.decodeBuffer(userpassEncoded));
+                //sun.misc.BASE64Decoder dec = new
sun.misc.BASE64Decoder();
+                //String userpassDecoded = new
String(dec.decodeBuffer(userpassEncoded));
+                // TODO: Migrate to java.util.Base64
+                java.util.Base64.Decoder decoder =
java.util.Base64.getMimeDecoder();
+                String userpassDecoded = new
String(decoder.decode(userpassEncoded));

I am currently testing this and if successful, would like to replace
it...also see

https://stackoverflow.com/questions/35301409/migrating-from-sun-misc-base64-to-java-8-java-util-base64

Any objections?

All the best

Michael


More information about the Yanel-development mailing list