title: MessageDigest NoSuchAlgorithmException
body: <p>I want to use <code>MessageDigest</code> to get a MD5 hash, but I get an error.</p>
  
  <pre><code>import java.security.MessageDigest;
  
  public class dn {
    public static void main(String[] args) {
      MessageDigest md = MessageDigest.getInstance("MD5");
    }
  }
  </code></pre>
  
  <p>Error: </p>
  
  <blockquote>
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
  Unhandled exception type NoSuchAlgorithmException
  </code></pre>
  </blockquote>
  
  <p>Error is referring to <br>
  <em>NoSuchAlgorithmException - if a MessageDigestSpi implementation for the specified algorithm is not available from the specified provider.</em> 
  <br>found on this site <a href="http://docs.oracle.com/javase/6/docs/api/java/security/MessageDigest.html" rel="noreferrer">http://docs.oracle.com/javase/6/docs/api/java/security/MessageDigest.html</a> under <em>getInstance</em></p>
  
  <p>I have reinstalled the latest java jdk1.7.0_21 and a different version of eclipse, but the error persists. Everything else runs fine on eclipse.</p>
  
  <p>I don't know what else could i do.</p>