Choosing and checking a JDK
What you will learn
A JDK is a Java Development Kit: it supplies a runtime and development tools such as javac. Install a supported, patched JDK from a trusted distribution before developing programs. A runtime alone may not include a compiler.
public class Main { public static void main(String[] args) { System.out.println("Runtime works"); }}Expected output:
Runtime worksThis checks that the program can launch, not whether the JDK is fully patched.
How it works
Use java -version and javac -version in your terminal to discover the actual tools. The output depends on the installation. PATH determines which executable your shell selects; JAVA_HOME is a convention used by many build tools, not a requirement for every Java command. The primary future lab is Java 25; the examples in this batch use a Java 21-compatible entry point.
public class Main { public static void main(String[] args) { System.out.println(9 * 8); }}Expected output:
72The independent expected output is 72.
Common mistakes
Do not infer the installed compiler version from an IDE project setting. Check the actual compiler and the IDE toolchain separately.
Try it yourself
Run the two version commands locally and record the versions and vendor. Do not copy the version shown in another learner’s screenshot.
These are local Java practice tasks, not automatically graded ByteMind exercises. Use a patched JDK; no network or third-party dependency is needed.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Choosing and checking a JDK — knowledge check
Check your understanding of choosing and checking a jdk.
Which tool compiles Java source?
What does java -version tell you?