HI Mier,
I dont know if this is a good practice...
But we usually give a java option like -DTomcat1 as the first java option.
For example in tomcat we add this in the catalina.sh
JAVA_OPTS="-DTomcat1 -server ................"
So when you do a ps -ef | grep java , we get to see the -D option and can identify the same.
Thanks,
Vipin