try{
MBeanServer server = MBeanUtils.createServer();
ObjectName name = new ObjectName("Catalina:type=Service,serviceName=Catalina");
server.invoke(name, "stop", new Object[0], new String[0]);
} catch (Exception e) {
e.printStackTrace();
}
然后,tomcat 停止了。就这么简单。