Chapter 13. Platform Tools and Profiles

This chapter discusses the tools that ship  with the Oracle and OpenJDK version of the Java platform. The tools covered mostly comprise command-line tools, but we also discuss the GUI tool jvisualvm. If you are using a different version of Java, you may find similar but different tools as part of your distribution instead.

Later in the chapter, we also discuss Java 8 profiles, which are cut-down installations of Java that nevertheless satisfy the language and virtual machine specifications.

Command-Line Tools

The command-line tools we cover are the most commonly used tools, and those of greatest utility—they are not a complete description of every tool that is available. In particular, tools concerned with CORBA and the server portion of RMI are not covered in detail.

Note
In some cases, we need to discuss switches that take filesystem paths. As elsewhere in the book, we use Unix conventions for such cases.

The tools we discuss are:

  • javac

  • java

  • jar

  • javadoc

  • jdeps

  • jps

  • jstat

  • jstatd

  • jinfo

  • jstack

  • jmap

  • javap

javac

Basic usage

javac some/package/MyClass.java

Description

javac is the Java source code  compiler—it produces bytecode (in the form of .class files) from .java source files.

For modern Java projects, javac is not often used directly, as it is rather low-level and unwieldy, especially for larger codebases. Instead, modern integrated development environments (IDEs) either drive javac automatically for the developer ...

Get Java in a Nutshell, 6th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.