Search code examples
javaeclipsevisualvm

How to run VisualVM Eclipse Plugin


I am trying to run Visual Plugin in Eclipse Juno. Visual VM usage instructions are confusing. Running my application on Tomcat server and I have no idea how to point it to Visual VM.
Usage Instructions:

  1. Create a new application configuration
  2. Choose the "VisualVM Launcher" as the application launcher
  3. Run/Debug the application with the created configuration to have VisualVM started automatically.

How would I choose Visual VM Launcher for my application which is running on Tomcat?


Solution

  • The VisualVM plugin for Eclipse is only useful when you can start the application from within Eclipse (i.e. when it's a plain Java application, not Tomcat or something that is to be deployed in Tomcat).

    In your case, just start jvisualvm (which you can find the same folder as javac) and select the Tomcat process in the dialog.

    Note that you may have to configure Tomcat to allow VisualVM to connect.

    Alternatively, you can create a launch config for Tomcat but to do this, you will have to read the startup files, collect all JARs that have to go into the classpath manually and correctly, collect startup parameters, use the correct "current directory", set a couple of system properties ... it's possible but you probably don't want to try.