Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JVisualVM: "Local Applications Cannot Be Detected"

I would like to monitor a local Java application using JVisualVM. When I'm starting it, the popup 'Local java application cannot be monitored' or 'Local Applications Cannot Be Detected' is shown. I have read here that it is a permissions problem. Every time when I grant full access to folder %TMP%hsperfdata_MY_USER_ID to me (logged user) and everyone (windows user), the permissions are reset when I start JVisualVM.

I know that another solution is to delete hsperfdata_MY_USER_ID, but why does the permissions trick not work? Is the permissions folder reset a Windows feature?

System : Windows 7

Tested on cmd started as administrator. I use the same accounts and I do not pass any JVM parameters such as com.sun.management.jmxremote.port=XXXX.

like image 810
Paweł Dulęba Avatar asked Oct 23 '25 01:10

Paweł Dulęba


1 Answers

For people stumbling here who have a FAT-type file system:

  • Make a directory (e.g. e:\temp) on an NTFS disk.
  • Start both java and jvisualvm with an environment variable TMP=E:\temp.

There are three options to set the environment variable for java:

  • In your IDE, go to the project options or launch options and find the 'Environment' entry, then enter TMP=E:\temp
  • Open a cmd prompt, and execute set TMP=E:\temp before launching youur java application from the same prompt.
  • Put the two lines you'd enter at the cmd prompt in a .bat file. Optinally add pause at the end of the bat file to prevent the console window from disappearing in case of a runtime exception or vm crash.

Similarly, for JVisualVM, use one of the last two options.

like image 195
Mark Jeronimus Avatar answered Oct 25 '25 16:10

Mark Jeronimus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!