Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

java - Unable to run VisualVM with Intellij or commandline

I downloaded visualvm 2.0.6 (currently latest) on windows.
I tried making the following attempts:

Integrating VisualVM with Intellij IDEA.

  1. I installed VisualVM Launcher plugin.
  2. Set the VisualVM executable path bin/visualvm.exe
  • Executing Run
  1. VisualVM window opens up.
  2. My program completed execution.
  3. VisualVm shows this error: can not open requested application
  4. Tried all solutions from this stackoverflow post.
  • Executing Debug
  1. VisualVM window opens up.
  2. I can see my application inside the Application node.
  3. Visualvm freezes completely and I cannot click/open my application to profile it. I had to end the task from the task manager.

Commandline way

After seeing no results from above, I tried to run my application normally using the command line.

  1. Opened visualvm.exe.
  2. Opened cmd, and executed the regular java command:
    java -classpath "path/to/all/jars/dependencies/" main.Main
    
  3. Program completed execution, but visualvm didn't show anything.

Other solutions from StackOverflow posts:

All the following didn't work:

  • Gave full access to folder %temp%/hsperfdata_<username>. [post]
  • Deleted %temp%/hsperfdata_<username> and closed all java applications, restarted VisualVM (which recreated the hsperfdata folder), and tried again. [post]
  • Explicitly tried to set the java.io.tmpdir while running VisualVm. [post]
    visualvm -J-Djava.io.tmpdir=[path/to/hsperfdata_<username>] 
    
  • Tried opening Intellij & cmd as administrators and run visualvm. [post]

Is there any step/process I am missing?
If any more information is required, let me know.
Shall I try any other open-source alternative for VisualVM?

question from:https://stackoverflow.com/questions/65952868/unable-to-run-visualvm-with-intellij-or-commandline

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...