What do you install to write, compile and run Java programs?
Options
- A JDK (Java Development Kit) (Correct option)
- Only a web browser with a Java plugin
- Only Maven, which downloads the rest
- Only a JavaScript runtime such as Node
Answer
A JDK (Java Development Kit)
Why
The JDK includes the compiler (javac), the runtime with the JVM and other tools.
Older Java versions also had a JRE (Java Runtime Environment), a package with only what is needed to run programs. Since JDK 11 Oracle offers only the JDK, and smaller runtimes can be built with jlink.
Common JDK distributions: Oracle JDK, OpenJDK builds such as Eclipse Temurin.
Remember
JDK = everything to develop and run Java.