import sun.misc.BASE64Encoder results in error compiled in Eclipse
That error is caused by your Eclipse configuration. You can reduce it to a warning. Better still, use a Base64 encoder that isn't part of a non-public API. Apache Commons has one, or when you're already on Java 1.8, then use java.util.Base64
.
is the sun.misc package still available in java?
I suggest you forget about the sun.misc.BASE64Encoder
and use Apache Commons Base64 class. Here is the link: http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html
Update (6/7/2017)
Using sun.misc.BASE64Encoder
will cause a compilation error with Java 9 and it is already giving a warning in Java 8.
The right class to use is Base64
in java.util
package.
Example:
import java.util.Base64;
Base64.getDecoder().decode(...);
How to get the JAR file for sun.misc.BASE64Encoder class?
Don't use sun.*
classes. For Base64 in Android, use its native class or add a library to your project that does this (Apache commons, etc.). Alternatively just copy the Android source code to your project (in your own package), if you need to use it on pre-2.2 devices.
sun.misc.BASE64Decoder showing error in java application
Don't use classes in the sun.misc package. These are deprecated and terrible. Check out Apache commons codec for base64 encoding and decoding. Why not to use sun.misc.* classes
Related Topics
How to Copy the Contents of One Arraylist into Another
Running Selenium Scripts with Jmeter
Block()/Blockfirst()/Blocklast() Are Blocking Error When Calling Bodytomono After Exchange()
How to Get *Everything* Back from a Stored Procedure Using Jdbc
Does Stream.Foreach Respect the Encounter Order of Sequential Streams
Why Does Main Method in Java Always Need Arguments
Using Comparable for Multiple Dynamic Fields of Vo in Java
Resize a Picture to Fit a Jlabel
Convert Java.Util.Hashmap to Scala.Collection.Immutable.Map in Java
Threads Configuration Based on No. of Cpu-Cores
Hashmap to Return Default Value for Non-Found Keys
Why Does Java App Crash in Gdb But Runs Normally in Real Life
Java: Subtract '0' from Char to Get an Int... Why Does This Work