Home > Java > javaTutorial > body text

Confusing JRE and JDK package naming in Linux Distros

DDD
Release: 2024-11-05 07:06:02
Original
759 people have browsed it

Observations on Installing Java Development Kit on Linux Distros

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.

Most distributions, including Fedora and Debian-based systems, provide:

  • JRE package under the name java-xx-openjdk.arch
  • JDK package as java-xx-openjdk-devel.arch

Quick Note on Installing Java JDK vs. JRE

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
Copy after login

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:

Confusing JRE and JDK package naming in Linux Distros

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!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template