'jhat' sources in OpenJDK
'jhat' source code is available in OpenJDK. Open 'jdk' project in NetBeans and expand 'Sources For All Platforms'. You can find the sources of 'jhat' in these packages:
It is possile to just build jhat.jar instead of building the whole jdk. In com.sun.tools.hat, you will find ant makefile build.xml. This can be used to build jhat.