(issue firstly discussed in here: http://mail-archives.apache.org/mod_mbox/lucene-solr-user/201809.mbox/%3C20180916154315.0922A29C@centrum.cz%3E)
Please notice the following lines added (among others) to "solr.cmd" by commit https://github.com/apache/lucene-solr/commit/b36c68b16e67ae701cefce052a4fdbaac88fb65c for https://issues.apache.org/jira/browse/SOLR-6833 about 4 years ago (v5.0):
Apparently, the new variable "TMP" is just a temporary one, but by coincidence, this variable is also important for JVM. As this system variable tells where the "hsperfdata_<username>" directory for storing applications' monitoring data should be located. And if this is changed, JDK tools like JVisualVM, jps and others won't locally see the given Java application, because they search in a different default location.
A working solution seems to be just to rename the TMP variable to for example TMP1 as in the attached simple-rename-fix.patch. Maybe even a simple "==" comparison of SOLR_HOME and EXAMPLE_DIR could (should?) be made, but I don't have enough time to study and test this scenario.