After recently switching to Linux, I encountered a notable difference in package naming conventions when installing Java Runtime Environment (JRE) and Java Development Kit (JDK). Many popular Linux distributions follow a similar pattern in naming these packages, but it can be a bit confusing at first.
It's easy to accidentally install only the JRE when you're actually looking to set up a full development environment (JDK), as the commands can appear deceptively similar.
For example:
# Installs only the Java Runtime Environment (JRE) sudo apt install java-21-openjdk # On Debian/Ubuntu sudo dnf install java-21-openjdk # On Fedora # Installs the full Java Development Kit (JDK) sudo apt install java-21-openjdk-devel sudo dnf install java-21-openjdk-devel
Summary
If you simply run apt install java-21-openjdk or dnf install java-21-openjdk, it will only set up the JRE. To ensure you have the full JDK (JVM JRE), use apt install java-21-openjdk-devel or dnf install java-21-openjdk-devel.
Below is a screenshot showing the Fedora package name and description for Java 21:
This should help anyone new to Linux avoid the same confusion when setting up Java.
The above is the detailed content of Confusing JRE and JDK package naming in Linux Distros. For more information, please follow other related articles on the PHP Chinese website!