I am trying to run visualvm under the username tomcat6, because apparently visualvm can find applications running under its username. Therefore, by default, it only works under my username. I was able to connect visualvm with tomcat6 via jmx, but it lacks the finer granularity of instrumental profiling.
I tried the following to run visualvm under the username tomcat6, but received the following error, which I do not understand.
$ sudo -u tomcat6 jvisualvm
No protocol specified
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
...
source
share