Enable JMX on tomcat:
Files such as startup.sh, shutdown.sh, catalina.sh, seclasspath.sh, and setenv.sh in tomcat/bin/ location are necessary.
In setenv.sh, there is only one sentence: export CATALINA_OPTS="-Dcom.sun.management.jmxremote"
In addition, you should change the last sentence "exec "$PRGDIR"/"$EXECUTABLE" start "$@"" into ""exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@""
If you want to change the port, you could change the port in catalina.sh file, for instance: JPDA_ADDRESS=8787.
It is used for enabling JMX Access on this tomcat. References: http://blog.mafr.de/2011/03/12/enabling-jmx-acces-on-tomcat/
In eclipse,
Debug As----> Debug Configurations----->Remote Java Application----> find corresponding project and set connect's port as 8000