This is setup in your WAS 5.1 server, since CFMX is running
on top of Websphere. Open your WAS admin. Go to environment in the
left navigation panel. Once the variables appear in your right pane
you will see JAVA_HOME mid way down the panel. Update it there. You
will probably need to restart WAS to have it take effect.