If you insist want to use sun.misc.BASE64Encoder
, in Eclipse, right click on the project, properties -> Java compiler –> Errors/Warnings –> Deprecated and restricted API –> Forbidden reference (access rules), change the default “Error” to “Warning“. Now, your code should be able to compile, but with some warning messages.
The above solution is not recommended, you should replace sun.misc.BASE64Encoder
with other BASE64 class like Apache common codec. that is http://commons.apache.org/proper/commons-codec/
import org.apache.commons.codec.binary.Base64;
//...
result = new Base64().encodeToString(rawHmac);