JDK in Java

Last Updated : 16 May, 2026

JDK (Java Development Kit) is a software package used to develop and run Java applications. It provides all the necessary tools required for writing, compiling, debugging, and executing Java programs. JDK is mainly used by Java developers to create Java-based applications.

  • It includes JRE (Java Runtime Environment) and development tools like the Java compiler (javac).
  • It helps developers compile, run, and debug Java programs.
  • JDK is platform-dependent and available for Windows, Linux, and macOS.

Note: JDK = JRE + Development Tools

jvm

Contents of JDK

The JDK has a private Java Virtual Machine (JVM) and a few other resources necessary for the development of a Java Application. 

JDK contains

  • Java Runtime Environment (JRE),
  • An interpreter/loader (Java),
  • A compiler (javac),
  • An archiver (jar) and many more.

The  Java Runtime Environment in JDK is usually called Private Runtime because it is separated from the regular JRE and has extra content. The Private Runtime in JDK contains a JVM and all the class libraries present in the production environment, as well as additional libraries useful to developers, e.g, internationalization libraries and the IDL libraries.

  • Oracle JDK: the most popular JDK and the main distributor of Java11,
  • OpenJDK: Ready for use: JDK 15, JDK 14, and JMC,
  • Azul Systems Zing: efficient and low latency JDK for Linux os,
  • Azul Systems: based Zulu brand for Linux, Windows, Mac OS X,
  • IBM J9 JDK: for AIX, Linux, Windows, and many other OS,
  • Amazon Corretto: the newest option with the no-cost build of OpenJDK and long-term support.

Set-Up

Setting up JDK in your development environment is super easy, just follow the below simple steps. 

Installation of JDK

  • Go to this Oracle's official Download Page through this link
  • Select the latest JDK version and click Download and add it to your classpath.
  • Just check the JDK software is installed or not on your computer at the correct location, for example, at C:\Program Files\Java\jdk11.0.9.

Set JAVA_HOME for Windows

  • Right-click My Computer -> Properties.
  • Open Advanced system settings -> Environment Variables.
  • Under System Variables, click New or Edit for JAVA_HOME.
  • Set the variable value to your JDK path, for example: C:\Program Files\Java\jdk-11.0.9
  • Click OK to save all settings.

Java is backward compatible, so installing the latest JDK provides both old and new features. After installing JDK/JRE, verify Java setup using

java -version

JDK Version

If the command does not work, restart your system once and then re-check after restarting.

Compile and Run Java Code using JDK

You can use the JDK compiler to convert your Java text file into an executable program. Your Java text segment is converted into bytecode after compilation which carries the .class extension.

First, create a Java text file and save it using a name. Here we are saving the file as Hello.java.

Java
class Hello{
    public static void main (String[] args) {
        System.out.println("Hello Geek!");
    }
}

Step 1: Compile the Java Program

Use the javac command to compile the program into bytecode (.class file).

C:\Users\Pinaki\Documents>javac Hello.java

After successful compilation, a file named Hello.class will be created in the same directory. If javac is not recognized, use the full path of javac.exe:

"C:\Program Files\Java\jdk-11.0.9\bin\javac.exe" Hello.java

Make sure you are in the correct directory or provide the full file path, otherwise you may get the error "The system cannot find the path specified".

Step 2: Run the Java Program

Use the java command to run the compiled class file.

C:\Users\Pinaki\Documents>java Hello

Output:

Hello Geek!

The Jar component

JDK contains many useful tools, and one of the most important tools after javac is the jar tool. A JAR (Java Archive) file is a compressed package that stores Java class files and related resources in a structured format. It helps combine multiple .class files into a single file for easy distribution and execution.

Before creating a JAR file, make sure you are in the same directory where the Hello.java file is saved and the Hello.class file has already been generated.

Creating a .jar file

C:\Users\Pinaki\Documents>"c:\Program Files\Java\jdk-11.0.9\bin\jar.exe" --create --file Hello.jar Hello.class

After executing the command, a Hello.jar file will be created in the same directory.

Running the JAR File

We can execute the program inside the JAR file by adding it to the classpath using the -cp option.

java -cp hello_world.jar hello_world

Important Components of JDK

Below there is a comprehensive list of mostly used components of Jdk which are very useful during the development of a java application.

Component

Use

javac

 Java compiler converts source code into Java bytecode

java 

 The loader of the java apps.

javap

 Class file disassembler,

javadoc 

 Documentation generator,

jar 

 Java Archiver helps manage JAR files.

appletviewer

  Debugging of Java applets without a web browser,

xjc 

  Accepts an XML schema and generates Java classes,

apt

  Annotation-processing tool,

jdb

  Debugger,

jmc

  Java Mission Control,

JConsole

  Monitoring and Management Console,

pack200 

  JAR compression tool,

extcheck

  Utility tool to detects JAR file conflicts,

idlj

  IDL-to-Java compiler,

keytool

  The keystore manipulating tool,

jstatd

  jstat daemon (experimental)

jstat

  JVM statistics monitoring tool 

jshell

  jshell introduced in java 9.

jstack

 Prints Java stack traces(experimental)

jrunscript

  Java command-line script shell.

jhat

 Java Heap Analysis Tool (experimental)

jpackage

 Generate self-contained application bundles.

javaws

 Web Start launcher for JNLP applications,

javah

 C header and stub generator,

jarsigner

 jar signing and verification tool

jinfo

configuration information(experimental)

javafxpackager

Package and sign JavaFX applications
Comment