src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java
author rschmelter
Mon, 22 Jul 2019 14:40:00 +0200
changeset 55758 bbe9c361a477
parent 50785 d1b24f2ceca5
permissions -rw-r--r--
8227868: jinfo and jstack can fail converting UTF8 output to strings Reviewed-by: sgehwolf, dholmes, cjplummer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
55758
bbe9c361a477 8227868: jinfo and jstack can fail converting UTF8 output to strings
rschmelter
parents: 50785
diff changeset
     2
 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.tools.jstack;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.InputStream;
38361
8ea2d56bfdf3 8154985: Add the ability to use main class as lookup (as jcmd) to jinfo, jmap, jstack
rehn
parents: 38360
diff changeset
    29
import java.util.Collection;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.attach.VirtualMachine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import sun.tools.attach.HotSpotVirtualMachine;
38361
8ea2d56bfdf3 8154985: Add the ability to use main class as lookup (as jcmd) to jinfo, jmap, jstack
rehn
parents: 38360
diff changeset
    33
import sun.tools.common.ProcessArgumentMatcher;
55758
bbe9c361a477 8227868: jinfo and jstack can fail converting UTF8 output to strings
rschmelter
parents: 50785
diff changeset
    34
import sun.tools.common.PrintStreamPrinter;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * This class is the main class for the JStack utility. It parses its arguments
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * and decides if the command should be executed by the SA JStack tool or by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * obtained the thread dump from a target process using the VM attach mechanism
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
public class JStack {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 25859
diff changeset
    42
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    public static void main(String[] args) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
        if (args.length == 0) {
21673
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
    45
            usage(1); // no arguments
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
38360
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    48
        checkForUnsupportedOptions(args);
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    49
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
        boolean locks = false;
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    51
        boolean extended = false;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        // Parse the options (arguments starting with "-" )
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
        int optionCount = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
        while (optionCount < args.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
            String arg = args[optionCount];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            if (!arg.startsWith("-")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
            }
48543
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
    60
            if (arg.equals("-?")     ||
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
    61
                arg.equals("-h")     ||
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
    62
                arg.equals("--help") ||
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
    63
                // -help: legacy.
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
    64
                arg.equals("-help")) {
21673
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
    65
                usage(0);
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
    66
            }
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
    67
            else {
38360
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    68
                if (arg.equals("-l")) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    69
                    locks = true;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
                } else {
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    71
                    if (arg.equals("-e")) {
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    72
                        extended = true;
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    73
                    } else {
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    74
                        usage(1);
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    75
                    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
            optionCount++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
38360
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    81
        // Next we check the parameter count.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        int paramCount = args.length - optionCount;
38360
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    83
        if (paramCount != 1) {
21673
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
    84
            usage(1);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
38360
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    87
        // pass -l to thread dump operation to get extra lock info
38361
8ea2d56bfdf3 8154985: Add the ability to use main class as lookup (as jcmd) to jinfo, jmap, jstack
rehn
parents: 38360
diff changeset
    88
        String pidArg = args[optionCount];
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    89
        String params[]= new String[] { "" };
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    90
        if (extended) {
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    91
            params[0] += "-e ";
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    92
        }
38360
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
    93
        if (locks) {
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    94
            params[0] += "-l";
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        }
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
    96
38956
cf2c4bfba78a 8156537: Tools using MonitoredVmUtil do not parse module in cmdline correctly
rehn
parents: 38361
diff changeset
    97
        ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg);
44422
14ab3266fe62 8176533: REGRESSION: a java process is not recognized by jcmd/jinfo/jstack/jmap tool
rehn
parents: 38956
diff changeset
    98
        Collection<String> pids = ap.getVirtualMachinePids(JStack.class);
38956
cf2c4bfba78a 8156537: Tools using MonitoredVmUtil do not parse module in cmdline correctly
rehn
parents: 38361
diff changeset
    99
44422
14ab3266fe62 8176533: REGRESSION: a java process is not recognized by jcmd/jinfo/jstack/jmap tool
rehn
parents: 38956
diff changeset
   100
        if (pids.isEmpty()) {
38956
cf2c4bfba78a 8156537: Tools using MonitoredVmUtil do not parse module in cmdline correctly
rehn
parents: 38361
diff changeset
   101
            System.err.println("Could not find any processes matching : '" + pidArg + "'");
cf2c4bfba78a 8156537: Tools using MonitoredVmUtil do not parse module in cmdline correctly
rehn
parents: 38361
diff changeset
   102
            System.exit(1);
cf2c4bfba78a 8156537: Tools using MonitoredVmUtil do not parse module in cmdline correctly
rehn
parents: 38361
diff changeset
   103
        }
cf2c4bfba78a 8156537: Tools using MonitoredVmUtil do not parse module in cmdline correctly
rehn
parents: 38361
diff changeset
   104
44422
14ab3266fe62 8176533: REGRESSION: a java process is not recognized by jcmd/jinfo/jstack/jmap tool
rehn
parents: 38956
diff changeset
   105
        for (String pid : pids) {
14ab3266fe62 8176533: REGRESSION: a java process is not recognized by jcmd/jinfo/jstack/jmap tool
rehn
parents: 38956
diff changeset
   106
            if (pids.size() > 1) {
14ab3266fe62 8176533: REGRESSION: a java process is not recognized by jcmd/jinfo/jstack/jmap tool
rehn
parents: 38956
diff changeset
   107
                System.out.println("Pid:" + pid);
38361
8ea2d56bfdf3 8154985: Add the ability to use main class as lookup (as jcmd) to jinfo, jmap, jstack
rehn
parents: 38360
diff changeset
   108
            }
44422
14ab3266fe62 8176533: REGRESSION: a java process is not recognized by jcmd/jinfo/jstack/jmap tool
rehn
parents: 38956
diff changeset
   109
            runThreadDump(pid, params);
38361
8ea2d56bfdf3 8154985: Add the ability to use main class as lookup (as jcmd) to jinfo, jmap, jstack
rehn
parents: 38360
diff changeset
   110
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    // Attach to pid and perform a thread dump
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    private static void runThreadDump(String pid, String args[]) throws Exception {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        VirtualMachine vm = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            vm = VirtualMachine.attach(pid);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        } catch (Exception x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            String msg = x.getMessage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            if (msg != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                System.err.println(pid + ": " + msg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                x.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            System.exit(1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        // Cast to HotSpotVirtualMachine as this is implementation specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        // method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        InputStream in = ((HotSpotVirtualMachine)vm).remoteDataDump((Object[])args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        // read to EOF and just print output
55758
bbe9c361a477 8227868: jinfo and jstack can fail converting UTF8 output to strings
rschmelter
parents: 50785
diff changeset
   132
        PrintStreamPrinter.drainUTF8(in, System.out);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        vm.detach();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
38360
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   136
    private static void checkForUnsupportedOptions(String[] args) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   137
        // Check arguments for -F, -m, and non-numeric value
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   138
        // and warn the user that SA is not supported anymore
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   139
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   140
        int paramCount = 0;
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   141
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   142
        for (String s : args) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   143
            if (s.equals("-F")) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   144
                SAOptionError("-F option used");
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   145
            }
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   146
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   147
            if (s.equals("-m")) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   148
                SAOptionError("-m option used");
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   149
            }
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   150
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   151
            if (! s.startsWith("-")) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   152
                paramCount += 1;
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   153
            }
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   154
        }
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   155
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   156
        if (paramCount > 1) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   157
            SAOptionError("More than one non-option argument");
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   158
        }
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   159
    }
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   160
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   161
    private static void SAOptionError(String msg) {
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   162
        System.err.println("Error: " + msg);
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   163
        System.err.println("Cannot connect to core dump or remote debug server. Use jhsdb jstack instead");
fb63be22ffa6 8155091: Remove SA related functions from tmtools
dsamersoff
parents: 36511
diff changeset
   164
        System.exit(1);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    // print usage message
21673
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
   168
    private static void usage(int exit) {
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
   169
        System.err.println("Usage:");
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
   170
        System.err.println("    jstack [-l][-e] <pid>");
21673
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
   171
        System.err.println("        (to connect to running process)");
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
   172
        System.err.println("");
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
   173
        System.err.println("Options:");
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
   174
        System.err.println("    -l  long listing. Prints additional information about locks");
50785
d1b24f2ceca5 8200720: Print additional information in thread dump (times, allocated bytes etc.)
ghaug
parents: 48543
diff changeset
   175
        System.err.println("    -e  extended listing. Prints additional information about threads");
48543
7067fe4e054e 8189102: All tools should support -?, -h and --help
goetz
parents: 47216
diff changeset
   176
        System.err.println("    -? -h --help -help to print this help message");
21673
c5d341bc60dd 8027765: Make exit codes and stdout/stderr printing from jmap/jinfo/jstack/jps consistent
sla
parents: 14342
diff changeset
   177
        System.exit(exit);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
}