Java - Java Development Kit (JDK)

About

The JDK is a SDK that:

  • embeds a JRE
  • and includes development tools and libraries (to create and compile Java applications)

The JDK is also known as:

  • Software Development Kit (J2SE SDK)

File Structure

A JDK image is simply a run-time image that happens to contain the full set of development tools and other items historically found in the JDK

The JDK can be found since Java 9 in two format:

  • non-modular (legacy, before Java 9)
  • modular (after Java 9)

Non-modular

A non-modular JDK image includes:

  • a copy of the JRE in its jre subdirectory
  • contains additional subdirectories:
    • bin: contains command-line development and debugging tools, e.g., javac, javadoc, and jconsole, along with duplicates of the binaries in the jre/bin directory for convenience
    • demo and sample directories contain demonstration programs and sample code, respectively
    • include contains C/C++ header files for use when compiling native code that interfaces directly with the run-time system
    • lib contains various JAR files and other types of files comprising the implementations of the JDK's tools, among them tools.jar, which contains the classes of the javac compiler.
  • release files: COPYRIGHT, LICENSE and README, and a release file that describes the image in terms of simple key/value property pairs, e.g.,

Example of JDK release file

IMPLEMENTOR="Eclipse Foundation"
IMPLEMENTOR_VERSION="Temurin-11.0.12+7"
JAVA_VERSION="11.0.12"
JAVA_VERSION_DATE="2021-07-20"
MODULES="java.base java.compiler java.datatransfer java.xml java.prefs java.desktop java.instrument java.logging java.management java.security.sasl java.naming java.rmi java.management.rmi java.net.http java.scripting java.security.jgss java.transaction.xa java.sql java.sql.rowset java.xml.crypto java.se java.smartcardio jdk.accessibility jdk.internal.vm.ci jdk.management jdk.unsupported jdk.internal.vm.compiler jdk.aot jdk.internal.jvmstat jdk.attach jdk.charsets jdk.compiler jdk.crypto.ec jdk.crypto.cryptoki jdk.crypto.mscapi jdk.dynalink jdk.internal.ed jdk.editpad jdk.hotspot.agent jdk.httpserver jdk.internal.le jdk.internal.opt jdk.internal.vm.compiler.management jdk.jartool jdk.javadoc jdk.jcmd jdk.management.agent jdk.jconsole jdk.jdeps jdk.jdwp.agent jdk.jdi jdk.jfr jdk.jlink jdk.jshell jdk.jsobject jdk.jstatd jdk.localedata jdk.management.jfr jdk.naming.dns jdk.naming.ldap jdk.naming.rmi jdk.net jdk.pack jdk.rmic jdk.scripting.nashorn jdk.scripting.nashorn.shell jdk.sctp jdk.security.auth jdk.security.jgss jdk.unsupported.desktop jdk.xml.dom jdk.zipfs"
OS_ARCH="x86_64"
OS_NAME="Windows"
SOURCE=".:git:179062f52626"
BUILD_SOURCE="git:2349d4e"
BUILD_SOURCE_REPO="https://github.com/adoptium/temurin-build.git"
SOURCE_REPO="https://github.com/adoptium/jdk11u.git"
FULL_VERSION="11.0.12+7"
SEMANTIC_VERSION="11.0.12+7"
BUILD_INFO="OS: Windows Server 2012 R2 Version: 6.3"
JVM_VARIANT="Hotspot"
JVM_VERSION="11.0.12+7"
IMAGE_TYPE="JDK"

Modular

A modular JDK image is a modular image with the demo, man, and include directories.

How to

Get it

To obtain the JDK:

Manager

Jabba

https://github.com/shyiko/jabba

  • Install once
jabba install [email protected]
jabba install [email protected]

And later switch to the desired runtime by executing:

jabba use [email protected] # OR jabba use [email protected]
sdkman
Asdf

Manually

Download an JDK image from a vendor and install it

For instance:

Self-Extracting Installation

  • Download the bin (Self-Extracting Installation)
jdk-6u<version>-linux-x64.bin
jdk-6u18-linux-x64.bin
  • Make it executable
chmod +x jdk-6u18-linux-x64.bin
  • Change to the directory where you would like the files to be installed.
cd installDir
  • The Java Development Kit files are installed in a directory called jdk.6.0_<version> in the current directory.
./jdk-6u <version>-linux-x64.bin

Powered by ComboStrap