Pre-General Availability: 2017-05-24

1 Tools and Commands Reference

The JDK tools and their commands enable developers to handle development tasks such as compiling and running a program, packaging source files in to a JAR file, applying security policies to a JAR file, and more.

The tools and command reference topic lists and describes the JDK tools. They are grouped into the following sections based on the related functions that they perform. Details about the tools and the commands that you use to run them are contained in the corresponding sections of this document.

Main Tools

The following foundation tools create and build applications:

  • javac: You can use the javac tools and its options to read Java class and interface definitions and compile them into bytecode and class files.

  • javap: You use the javap command to disassemble one or more class files.

  • javah: You use the javah tool to generate C header and source files from a Java class.

  • javadoc: You use the javadoc tool and options to generate HTML pages of API documentation from Java source files.

  • java: You can use the java command to launch a Java application.

  • appletviewer: You use the appletviewer command to launch the AppletViewer and run applets outside of a web browser.

  • jar: You can use the jar command to create an archive for classes and resources, and manipulate or restore individual classes or resources from an archive.

  • jlink: You can use the jlink tool to assemble and optimize a set of modules and their dependencies into a custom runtime image.

  • jmod: You use jmod to create JMOD files and list the content of existing JMOD files.

  • jdeps: You use the jdeps command to launch the Java class dependency analyzer.

  • jdeprscan: You use the jdeprscan tool as a static analysis tool that scans a jar file (or some other aggregation of class files) for uses of deprecated API elements.

Security Tools

The following security tools set security policies on your system and create applications that can work within the scope of security policies set at remote sites:

  • keytool: You use the keytool command and options to manage a keystore (database) of cryptographic keys, X.509 certificate chains, and trusted certificates.

  • jarsigner: You use the jarsigner tool to sign and verify Java Archive (JAR) files.

  • policytool: You use policytool to read and write a plain text policy file based on user input through the utility GUI.

The following tools obtain, list, and manage Kerberos tickets on Windows:

  • kinit: You use the kinit tool and its options to obtain and cache Kerberos ticket-granting tickets.

  • klist: You use klist tool to display the entries in the local credentials cache and key table.

  • ktab: You use the ktab tool to manage the principal names and service keys stored in a local key table.

Remote Method Invocation (RMI) Tools

The following tools enable creating applications that interact over the Web or other network:

  • rmic: You use the rmic compiler to generate stub and skeleton class files using the Java Remote Method Protocol (JRMP) and stub and tie class files (IIOP protocol) for remote objects.

  • rmiregistry: You use the rmiregistry command to create and start a remote object registry on the specified port on the current host.

  • rmid: You use the rmid command to start the activation system daemon that enables objects to be registered and activated in a Java Virtual Machine (JVM).

  • serialver: You use the serialver command to return the serialVersionUID for one or more classes in a form suitable for copying into an evolving class.

Java IDL and RMI-IIOP Tools

The following tools enable creating applications that use OMG-standard IDL and CORBA/IIOP:

  • tnameserv: You use the tnameserv command as a substitute for Object Request Broker Daemon (ORBD).

  • idlj: You use the idlj command to generate Java bindings for a specified Interface Definition Language (IDL) file.

  • orbd: You use the orbd command for the client to transparently locate and call persistent objects on servers in the CORBA environment.

  • servertool: You use the servertool command-line tool to register, unregister, start up, and shut down a persistent server.

Java Deployment Tools

The following utilities enable deploying Java applications and applets on the web:

  • pack200: You use the pack200 command to transform a JAR file into a compressed pack200 file with the Java gzip compressor.

  • unpack200: You use the unpack200 command to transform a packed file into a JAR file for web deployment.

  • javapackager: You use the javapackager command to perform tasks related to packaging Java and JavaFX applications.

Java Web Start

The following utility launches Java Web Start applications:

  • javaws: You use the javaws tool command and its options to start Java Web Start.

Monitoring Tools

The following tools monitor performance statistics:

Note:

Tools identified below as experimental are unsupported and should be used with that understanding. They may not be available in future JDK versions.

  • jconsole: You use the jconsole command to start a graphical console to monitor and manage Java applications.

  • jps: Experimental You use the jps command to list the instrumented JVMs on the target system.

  • jstat: Experimental You use jstat to monitor JVM statistics. This command is experimental and unsupported.

  • jstatd: Experimental You use the jstatd command to monitor the creation and termination of instrumented Java HotSpot VMs. This command is experimental and unsupported.

Java Web Services Tools

The following tools enable creating applications that provide web services:

  • schemagen: You can use the schemagen tool and commands to generate a schema for every name space that’s referenced in your Java classes.

  • wsgen: You use the wsgen command to generate Java API for XML Web Services (JAX-WS) portable artifacts used in JAX-WS web services.

  • wsimport: You use the wsimport command to generate Java API for XML Web Services (JAX-WS) portable artifacts.

  • xjc: You use the xjc shell script to compile an XML schema file into fully annotated Java classes.

Java Accessibility Utilities

The following utilities check accessibility of Java objects:

  • jaccessinspector: You use the jaccessinspector accessibility evaluation tool for the Java Accessibility Utilities API to examine accessible information about the objects in the Java Virtual Machine.

  • jaccesswalker: You use the jaccesswalker to navigate through the component trees in a particular Java Virtual Machine and presents the hierarchy in a tree view.

Troubleshooting Tools

The following tools perform specific troubleshooting tasks:

Note:

Tools identified below as experimental are unsupported and should be used with that understanding. They may not be available in future JDK versions. Some of these tools aren’t currently available on Windows platforms.

  • jcmd: You use the jcmd utility to send diagnostic command requests to a running Java Virtual Machine (JVM).

  • jdb: You use the jdb command and options to find and fix bugs in Java platform programs.

  • jhsdb: You use the jhsdb tool to attach to a Java process or to launch a postmortem debugger to analyze the content of a core-dump from a crashed Java Virtual Machine (JVM).

  • jinfo: Experimental You use the jinfo command to generate Java configuration information for a specified Java process or core file or a remote debug server. This command is experimental and unsupported.

  • jmap: Experimental You use the jmap command to print shared object memory maps or heap memory details of a specified process or a remote debug server. This command is experimental and unsupported.

  • jstack: Experimental You use the jstack command to print Java stack traces of Java threads for a specified Java process, core file, or remote debug server. This command is experimental and unsupported.

Scripting Tools

The following tools run scripts that interact with the Java platform:

Note:

Tools identified below as experimental are unsupported and should be used with that understanding. They may not be available in future JDK versions.

  • jjs: You use the jjs command-line tool to invoke the Nashorn engine.

  • jrunscript: Experimental You use the jrunscript command to run a command-line script shell that supports interactive and batch modes.

Language Shell

The following tool provides an interactive environment for trying out the Java language:

  • jshell: You use the jshell tool to interactively evaluate declarations, statements, and expressions of the Java programming language in a read-eval-print loop (REPL).