Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Visual VM from eclipse

I am trying to debug a java app using Visual VM in Eclipse kepler. I am executing the class having main method selecting Visual VM as launcher. I have configured Visual VM as per the instructions given in http://blog.idrsolutions.com/2013/05/setting-up-visualvm-in-under-5-minutes. I am getting the following error:

An internal error occurred during: “Launching TestNew”.
java.lang.NullPointerException

“TestNew” is the name of the class with main method I am trying to execute.

please help.

like image 377
Anushree Acharjee Avatar asked Sep 12 '14 09:09

Anushree Acharjee


2 Answers

I had the same issue... Let me expand a bit on Anushree's comment:

  • Go to WindowPreferencesRun/DebugLaunchingVisualVM Configuration
  • Browse... for the VisualVM Executable in your JDK's bin-directory
  • Make sure to also set the JDK's root directory under JDK Home. If you leave that pointing to your JRE directory, you'll run into the next error...

Happy profiling...

BTW: If you then have issues getting your application to show up inside jVisualVM, take a look here: Getting Java program running in Eclipse to show up in VisualVM

like image 128
Markus A. Avatar answered Nov 15 '22 03:11

Markus A.


For Linux users :

  1. Once visual vm launcher is intalled in eclipse , install visual vm in linux using command "sudo apt-get install -y visualvm".
  2. On successfull installation , in terminal search for

whereis visualvm

  1. The search will give following responses :

visualvm: /usr/bin/visualvm /etc/visualvm /usr/share/visualvm /usr/share/man/man1/visualvm.1.gz

  1. In eclipse go to Window --> Preferences --> Run/Debug --> Launching --> VisualVM Configuration

  2. copy the value "/usr/bin/visualvm" in the space and click on apply & close.

like image 1
Vignesh_A Avatar answered Nov 15 '22 05:11

Vignesh_A