
The Java Development Kit (JDK) is a versatile software development environment that provides tools and libraries for creating Java-based software applications and applets. It plays a central role in the Java ecosystem, working alongside the JVM (Java Virtual Machine) and the JRE (Java Runtime Environment).
For newcomers, distinguishing between JRE and JDK can be confusing. If you aim solely to run Java programs on your computer, you can achieve that using the Java Runtime Environment (JRE). However, if you aspire to develop Java-based software applications, you'll require more than just the JRE. In this case, you'll need the JDK, which includes the essential tools for development.
We can say that.: JDK = JRE + Development tools
The JDK (Java Development Kit) includes several important components:
Java Runtime Environment (JRE): This is like a mini Java environment that allows you to run Java applications.
Interpreter/Loader (Java): This component helps load and execute Java programs.
Compiler (javac): It translates your Java code into a format the computer can understand.
Archiver (jar): This tool packages multiple files into one archive file, often used for distributing Java applications.
In the JDK, the Java Runtime Environment is often called the "Private Runtime" because it differs slightly from the regular JRE. It includes a Java Virtual Machine (JVM) and all the class libraries found in the production environment. JDK contains extra libraries for developers, such as those for internationalization and IDL.
Here are some of the most popular JDKs:
Oracle JDK: This is the most widely used JDK and is the primary source for Java 11.
OpenJDK: It's ready for use and includes versions like JDK 15, JDK 14, and JMC (Java Mission Control).
Azul Systems Zing: Known for its efficiency and low latency, it's designed for Linux operating systems.
Azul Systems Zulu: This is based on the Zulu brand and works on Linux, Windows, and macOS.
IBM J9 JDK: It's designed for AIX, Linux, Windows, and other operating systems.
Amazon Corretto: This newer option offers a no-cost build of OpenJDK with long-term support.
Setting up the JDK in your development environment is quite straightforward. Here are the steps:
Setting JAVA_HOME for Windows:
Right-click on My Computer and select Properties. Go to the Advanced tab, then select Environment Variables. Edit JAVA_HOME to point to where your JDK software is stored. For example, C:\Program Files\Java\jdk11.0.9 is the default location in Windows. Java maintains all backward compatibility, so you don't have to worry. Download the latest release, and you'll get access to all the old and many new features. After installing the JDK and JRE, you can use the java command in your command line. You can verify the installation by running the java -version command. Sometimes, you may need to restart your system after installing the JDK.| 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 |