- Go to Window-->Preferences-->Java-->Compiler-->Error/Warnings.
- Select Deprecated and Restricted API. Change it to warning.
- Change forbidden and Discouraged Reference and change it to warning. (or as your need.)
From: http://stackoverflow.com/questions/5549464/import-sun-misc-base64encoder-got-error-in-eclipse