public static String[] createJVisualVmCommand(String jmxServiceUrl,String javaHomeDir){
  List<String> commandArray=new ArrayList<String>(5);
  if (javaHomeDir == null) {
    javaHomeDir=calculateJavaHome();
  }
  if (javaHomeDir != null) {
    commandArray.add(javaHomeDir + File.separator + "bin"+ File.separator+ "jvisualvm");
  }
 else {
    commandArray.add("jvisualvm");
  }
  commandArray.add("--openjmx");
  commandArray.add(jmxServiceUrl);
  commandArray.add("--nosplash");
  if (_logger.isLoggable(Level.FINE)) {
    _logger.log(Level.FINE,"all jvisualvm parameters:" + commandArray);
  }
  return commandArray.toArray(new String[commandArray.size()]);
}

public static String [ ] createJVisualVmCommand ( String jmxServiceUrl , String javaHomeDir ) { List < String > commandArray = new ArrayList < String > ( 5 ) ; if ( javaHomeDir == null ) { javaHomeDir = calculateJavaHome ( ) ; } if ( javaHomeDir != null ) { commandArray . add ( javaHomeDir + File . separator + "bin" + File . separator + "jvisualvm" ) ; } else { commandArray . add ( "jvisualvm" ) ; } commandArray . add ( "--openjmx" ) ; commandArray . add ( jmxServiceUrl ) ; commandArray . add ( "--nosplash" ) ; if ( _logger . isLoggable ( Level . FINE ) ) { _logger . log ( Level . FINE , "all jvisualvm parameters:" + commandArray ) ; } return commandArray . toArray ( new String [ commandArray . size ( ) ] ) ; }
this method creates jconosle command , jdk 1 . 6 used or later version then plugin parameter will be used with topthreads or jtop last tab
