jvisualvm in Unix

12,444

Solution 1

Just type in your terminal:

/Prj/tools/java/bin/jvisualvm

And hit enter. If you want to pass some arguments or options (like JDK home) put it after "jvisualvm" in the command above using the format provided by help.

Solution 2

You can setup the remote connectivity to the unix box from the jvisualvm.

Else, you can set the DISPLAY parameter of the unix to your desktop IP [like DISPLAY=<your IP>:0.0;export DISPLAY] Note: Use the unix command according to your SHELL

Solution 3

  1. Use Mobaxterm tool to connect to Linux box.
  2. set display variable as: setenv DISPLAY :0.0
  3. go to /bin
  4. Launch as: ./jvisualvm

I hope this works

Share:
12,444
Vivek Dhiman
Author by

Vivek Dhiman

Updated on July 03, 2022

Comments

  • Vivek Dhiman
    Vivek Dhiman almost 2 years

    We started to check the performance of my application as its getting slow after some time. I am using jvisualvm to observe the cause. Can anyone tell how can i use jvisualvm in Unix as in Windows we can check it through UI. Can we have the same view in Unix also.

    Lets my path to jvisualvm is /Prj/tools/java/bin/jvisualvm

    When i use help,

    Usage: /Prj/tools/java/bin/../lib/visualvm//platform7/lib/nbexec {options} arguments  
    
    General options:  
      --help                show this help  
      --jdkhome <path>      path to Java(TM) 2 SDK, Standard Edition  
      -J<jvm_option>        pass <jvm_option> to JVM  
    
      --cp:p <classpath>    prepend <classpath> to classpath  
      --cp:a <classpath>    append <classpath> to classpath  
    Core options:  
      --laf <LaF classname> use given LookAndFeel class instead of the default  
      --fontsize <size>     set the base font size of the user interface, in points  
      --locale <language[:country[:variant]]> use specified locale  
      --userdir <path>      use specified directory to store user settings  
    
    Module reload options:  
      --reload /path/to/module.jar  Installs or reinstalls a module JAR file.
    
  • Vivek Dhiman
    Vivek Dhiman over 10 years
    yes I am using : [server-name bin]$/Prj/tools/java/bin/jvisualvm &enter. It stops for 3-4 sec then nothing happens. prompt comes to next line.
  • Vivek Dhiman
    Vivek Dhiman over 10 years
    I am already in JDK bin directory and if If use command like : [server-name bin]$/Prj/tools/java/bin/jvisualvm &enter. It stops for 3-4 sec then nothing happens. prompt comes to next line
  • Mateusz Dymczyk
    Mateusz Dymczyk over 10 years
    do you have JAVA_HOME set up? what does "echo $JAVA_HOME" print?
  • Vivek Dhiman
    Vivek Dhiman over 10 years
    I did try but getting below exception: java.lang.InternalError: Can't connect to X11 window server using 'xxx.xxx.xx.xx:0.0' as the value of the DISPLAY variable.
  • G.S
    G.S over 10 years
    Probably the firewall issue... I am not aware how to fix the firewall
  • Vivek Dhiman
    Vivek Dhiman over 10 years
    Earlier It was not set, Now I set and after echo $JAVA_HOME it prints /Prj/tools/java . But still same internal error.
  • Mateusz Dymczyk
    Mateusz Dymczyk over 10 years
    @Champ23 wait, are you doing it remotely? if so then how are you connecting to the server?
  • Vivek Dhiman
    Vivek Dhiman over 10 years
    Yes, Remotely. I am trying to access server through putty.
  • Mateusz Dymczyk
    Mateusz Dymczyk over 10 years
    @Champ23 and are you running it with X Forwarding?
  • Vivek Dhiman
    Vivek Dhiman over 10 years
    We connect through VPN and then Using remote desktop we do task.About X forwarding i don't know as the setup is given by client
  • Mateusz Dymczyk
    Mateusz Dymczyk over 10 years
    @Champ23 remote desktop? so you can use other GUI applications there? it's not only a bare terminal (command line)? I though (still think) it's something with how X server is configured at the Unix machine
  • Vivek Dhiman
    Vivek Dhiman over 10 years
    Yes X forwarding, as in error i can see it on Linux. Yes through VPN we have access on remote desktop to access UI of application and Linux server through puyty.