The JDK (Java Development Kit) includes everything you need: the compiler (javac), the runtime (java), and a set of standard libraries. Without the JDK, you can't compile Java code.
Go to adoptium.net and download the latest LTS version (currently Java ). Pick the installer that matches your operating system. Run the installer with the default settings.
Once installed, open a terminal and type:
java -version
You should see output showing the version number. If the terminal says "command not found," the JDK bin directory is not on your system PATH. On Windows, reopen the terminal after installation. On macOS or Linux, restart your shell session.