ssdeep 9 Light Poster

i need help using MAC from javax.crypto package. i am able to generate MAC codes using keys but i am getting different mac's for the same message using the same key.can anyone plz give a small foolproof code to generate mac from say a small message like "hello world" so that some time later in the program if u use the same key and mac object u shud get the same code.