---
title: "使用JVisualVM连接tomcat"
author: "matt.u"
date: "2011-09-05T15:00:49Z"
tags: []
categories: ["Web前端"]
slug: "jvisualvm-tomcat"
draft: false
lastmod: "2011-09-05T15:00:49Z"
id: 1165817
url: "https://matt-u.iteye.com/blog/1165817"
---

在catalina.sh中加入以下语句：

```java
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8849 -Dcom.sun.management.jmxremote.ssl=false -Dco
m.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=202.202.208.70"
```



如果不加-Djava.rmi.server.hostname=202.202.208.70会在某些机器上无法连接。详细原因待查。