class StartJVisualVMCommand extends OfflineGfshCommand {

  String getProcessOutput(String[] jvmArgs) throws IOException {
    String[] jvisualvmCommandLine = createJVisualVMCommandLine(jvmArgs);

    if (isDebugging()) {
      getGfsh().printAsInfo(
          String.format("JVisualVM command-line (%1$s)", Arrays.toString(jvisualvmCommandLine)));
    }

    Process jvisualvmProcess = Runtime.getRuntime().exec(jvisualvmCommandLine);
    getGfsh().printAsInfo(CliStrings.START_JVISUALVM__RUN);
    return waitAndCaptureProcessStandardErrorStream(jvisualvmProcess);
  }

}