Table of Contents
Integrating the VisualVM Profiler with Eclipse
Note: These instructions assume that you have already downloaded and installed the VisualVM.
Installing/Configuring the Plugin
- Download the .zip file containing the plugin from the IDE integration page.
- Extract the .zip file to an appropriate location.
- Start Eclipse.
- Click on Help+Install new software.
- Click on Add…, click on Local… and navigate to the directory/folder containing the extracted plugin.
- Expand the tree and select “Visual VM Launcher Feature”.
- Click on Next and complete the installation.
- Click on Window>+<key>Preferences or Eclipse>+<key>Preferences (depending on your OS), expand “Run/Debug”, expand “Launching”, and select “VisualVM Configuration”.
- Enter the path to the “VisualVM Executable” and, if necessary, the JDK (not the JRE) you are using.
- Click on Apply and Close.
Using the Plugin
To run an application with the VisualVM you need to create a fun configuration for your project.
- Select the project.
- Click on Run+Run Configurations….
- Select “Java Application” and click on the new configuration button.
- Enter an appropriate name (e.g., “Profile MyApplication”).
- Enter the name of the main class.
- Next to the message about “Multiple launchers available”, click on “Select one…”, select “Use configuration specific settings”, select “VisualVM Launcher”, and click on OK.
- Click on Run.
At this point, the application should start executing, the VisualVM should start executing, the appropriate application should be selected, and you should be able to begin profiling. For help, with profiling, see the page on profiling java programs.