Is the following java code sufficient for clearing the secret key in memory (setting all of its byte value to 0)?
zerorize(SecretKey key)
{
byte[] rawKey
Except primitive values, everything else in Java is always passed by reference, including arrays, so yes, you are clearing the given byte array correctly.
However, SecretKey class probably still holds data needed to generate that byte array, there including eventually another copy of the given byte array, so you should investigate how to clear that data as well.