8203014: jcmd should output command list if no command is given
Reviewed-by: sspitsyn, simonis
--- a/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java Tue May 29 11:20:04 2018 -0700
+++ b/src/jdk.jcmd/share/classes/sun/tools/jcmd/Arguments.java Tue May 29 20:57:42 2018 +0200
@@ -88,7 +88,9 @@
}
if (listCounters != true && sb.length() == 0) {
- throw new IllegalArgumentException("No command specified");
+ // Omitting the command shall cause the target VM to print out a list
+ // of available commands.
+ sb.append("help");
}
command = sb.toString().trim();