Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jcmd.jmod - JCmd Tool
JDK 17 jdk.jcmd.jmod is the JMOD file for JDK 17 JCmd tool,
which can be invoked by the "jcmd" command.
JDK 17 JCmd tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jcmd.jmod.
JDK 17 JCmd tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JCmd source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jcmd.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ sun/tools/jstack/JStack.java
/*
* Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package sun.tools.jstack;
import java.io.InputStream;
import java.util.Collection;
import com.sun.tools.attach.VirtualMachine;
import sun.tools.attach.HotSpotVirtualMachine;
import sun.tools.common.ProcessArgumentMatcher;
import sun.tools.common.PrintStreamPrinter;
/*
* This class is the main class for the JStack utility. It parses its arguments
* and decides if the command should be executed by the SA JStack tool or by
* obtained the thread dump from a target process using the VM attach mechanism
*/
public class JStack {
public static void main(String[] args) throws Exception {
if (args.length == 0) {
usage(1); // no arguments
}
checkForUnsupportedOptions(args);
boolean locks = false;
boolean extended = false;
// Parse the options (arguments starting with "-" )
int optionCount = 0;
while (optionCount < args.length) {
String arg = args[optionCount];
if (!arg.startsWith("-")) {
break;
}
if (arg.equals("-?") ||
arg.equals("-h") ||
arg.equals("--help") ||
// -help: legacy.
arg.equals("-help")) {
usage(0);
}
else {
if (arg.equals("-l")) {
locks = true;
} else {
if (arg.equals("-e")) {
extended = true;
} else {
usage(1);
}
}
}
optionCount++;
}
// Next we check the parameter count.
int paramCount = args.length - optionCount;
if (paramCount != 1) {
usage(1);
}
// pass -l to thread dump operation to get extra lock info
String pidArg = args[optionCount];
String params[]= new String[] { "" };
if (extended) {
params[0] += "-e ";
}
if (locks) {
params[0] += "-l";
}
ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg);
Collection<String> pids = ap.getVirtualMachinePids(JStack.class);
if (pids.isEmpty()) {
System.err.println("Could not find any processes matching : '" + pidArg + "'");
System.exit(1);
}
for (String pid : pids) {
if (pids.size() > 1) {
System.out.println("Pid:" + pid);
}
runThreadDump(pid, params);
}
}
// Attach to pid and perform a thread dump
private static void runThreadDump(String pid, String args[]) throws Exception {
VirtualMachine vm = null;
try {
vm = VirtualMachine.attach(pid);
} catch (Exception x) {
String msg = x.getMessage();
if (msg != null) {
System.err.println(pid + ": " + msg);
} else {
x.printStackTrace();
}
System.exit(1);
}
// Cast to HotSpotVirtualMachine as this is implementation specific
// method.
InputStream in = ((HotSpotVirtualMachine)vm).remoteDataDump((Object[])args);
// read to EOF and just print output
PrintStreamPrinter.drainUTF8(in, System.out);
vm.detach();
}
private static void checkForUnsupportedOptions(String[] args) {
// Check arguments for -F, -m, and non-numeric value
// and warn the user that SA is not supported anymore
int paramCount = 0;
for (String s : args) {
if (s.equals("-F")) {
SAOptionError("-F option used");
}
if (s.equals("-m")) {
SAOptionError("-m option used");
}
if (! s.startsWith("-")) {
paramCount += 1;
}
}
if (paramCount > 1) {
SAOptionError("More than one non-option argument");
}
}
private static void SAOptionError(String msg) {
System.err.println("Error: " + msg);
System.err.println("Cannot connect to core dump or remote debug server. Use jhsdb jstack instead");
System.exit(1);
}
// print usage message
private static void usage(int exit) {
System.err.println("Usage:");
System.err.println(" jstack [-l][-e] <pid>");
System.err.println(" (to connect to running process)");
System.err.println("");
System.err.println("Options:");
System.err.println(" -l long listing. Prints additional information about locks");
System.err.println(" -e extended listing. Prints additional information about threads");
System.err.println(" -? -h --help -help to print this help message");
System.exit(exit);
}
}
⏎ sun/tools/jstack/JStack.java
Or download all of them as a single archive file:
File name: jdk.jcmd-17.0.5-src.zip File size: 51997 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jconsole.jmod - JConsole Tool
2023-08-17, ≈10🔥, 0💬
Popular Posts:
commons-fileupload-1.3.3 -sources.jaris the source JAR file for Apache Commons FileUpload 1.3., whic...
JDK 11 jdk.aot.jmod is the JMOD file for JDK 11 Ahead-of-Time (AOT) Compiler module. JDK 11 AOT Comp...
JDK 11 jdk.crypto.ec.jmod is the JMOD file for JDK 11 Crypto EC module. JDK 11 Crypto EC module comp...
How to download and install ojdbc5.jar for Oracle 11g R1? ojdbc5.jar for Oracle 11g R1 is a Java 5 J...
Where to get the Java source code for Connector/J 8.0 Protocol Impl module? Java source code files f...