5

From what I've heard 'JDK' stands for Java Development Kit, and on Debian based systems you install default-jdk to get a running javac. However on Fedora (at least the recent ones) installing java-openjdk won't install javac but you have to install java-openjdk-devel for example.

Do I misunderstand the concept of JDK regarding javac? Or why does a package having a name containing 'jdk' not provide javac on Fedora? I would understand if there was only a java-openjdk-devel because JDK implies 'devel' but then I don't understand what java-openjdk (without the devel) stands for.

frans
  • 1,057
  • 2
  • 14
  • 27

3 Answers3

2

This reflects the upstream project structure. There isn't a separate "OpenJRE" as an open source project — it's just "OpenJDK". Correspondingly, the package description for the base package is "The OpenJDK runtime environment 8", not "JRE".

mattdm
  • 2,781
  • 21
  • 28
  • 1
    So it seems to be up to the packager to "correct" this, doesn't it? On Debian/Ubuntu there _is_ a `default-jre` and a `default-jdk` package, though there is an `openjdk-*-jre` package and funnily a `openjdk-*-jdk` package as well.. Seems consistent with the versioning of Java from a logical perspective in my eyes – frans Jan 05 '21 at 06:42
  • Well, maybe? Is it more consistent for each package follow an arbitrary scheme that seems to make logical sense to its packager, or to follow what the upstream does in each case? – mattdm Jan 05 '21 at 19:18
1

OpenJDK is a name of the project that provides open-source JDK implementation. JRE is the end-user subset of it, without development tools.

java-openjdk is the end-user part of OpenJDK, ie. the JRE.
java-openjdk-devel is for developers - the whole JDK as implemented by the OpenJDK.

gronostaj
  • 55,965
  • 20
  • 120
  • 179
  • 1
    This is an example for very bad naming :) It's hard to find an equally bad one in my opinion.. – frans Jan 11 '21 at 12:49
0

installing java-openjdk won't install javac

java-openjdk installs the JRE (Java Runtime Environment).

java-openjdk-devel installs the Java Compiler (in addition to the JRE).

Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.

On the command line, type:

$ su -c "yum install java-1.8.0-openjdk"

The java-1.8.0-openjdk package contains just the Java Runtime Environment. If you want to develop Java programs then install the java-1.8.0-openjdk-devel package.

Source OpenJDK: Download and install

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
  • You stated what I've written (or did I miss something?) My question is "why". Why isn't `java-openjdk` called `java-openjre` and `java-openjdk-devel` `java-openjdk` instead? A "JDK" without `javac` is not a JDK so the name is simply wrong, isnt it? – frans Jan 02 '21 at 11:11
  • Why (is the name wrong) is a question we cannot answer. Please go and ask the OpenJDK developers. – DavidPostill Jan 02 '21 at 11:29
  • The not so obvious answer seems to be that the product's atomic name already contains a component which is used as a name for a subcomponent in a similar context. Like calling "Android" "AndroidSDK" instead and it's SDK "AndroidSDK-SDK" – frans Jan 11 '21 at 12:54