Hacker News new | ask | show | jobs
by eropple 2787 days ago
If it couldn't find a JDK, it usually means you didn't install the appropriate `-devel` package. (This is consistent across RHEL derivatives.)
1 comments

It is a problem if the default JDK is useless and the solution requires research on the internet. I had even enough patience to search for more than 15 minutes AFAIR.

I have been using Windows and other Linux distributions including Arch Linux for years and never had problems with the JDK.

You didn't install a JDK, though. You installed a JRE. (Ubuntu does this too, BTW - openjdk-N-jre versus openjdk-N-jdk.) If you Google "fedora jdk install" I get this page:

https://openjdk.java.net/install/

Which says pretty clearly: "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."

The standard package is to run software, not to compile software. Because most people who manage systems--hi--want to know what can be built on a system (and, more importantly, what can't be). You might not like that, and that's totally fine, but it's consistent and in my experience distros that have trouble with that (CentOS never, Ubuntu rarely, Arch rather often) quickly become ones I don't consider reliable.

I think the issue here is the stupid name "OpenJDK" - everyone who has anything to do with Java development understands JDK to mean "Java Development Kit", and here those sneaky bastards give you a package named "jdk" but containing jre.

Would it hurt them to name the project "OpenJVM" instead?

When I wrote that post I was thinking exactly that.

Honestly, were I running Debian/Ubuntu I probably would have at least called it `openjdk-N` and `openjdk-N-dev`, to match the other `-dev` packages, but...yeah. In this way I think CentOS/Fedora are a little more straightforward.

In Ubuntu it is called openjdk-11-jre and openjdk-11-jdk. With headless variants.

I am no system admin and the -dev or -devel convention suits the Unix and C world but maybe not the JVM or .net or nodejs worlds with their own standards and package managers.

How so? `java` is the JRE. `javac` is the JDK. `mono` (I forget the .NET Core executable name) is the runtime, `mcs` is the development tool. Node or Ruby or Python all have similar splits, too. Yes, they're interpreters, but you generally need the `-dev`/`-devel` package to compile things against your runtime there, too. Their package managers are orthogonal to this (but a failed Ruby build, as an example, will often tell you you need development packages for a library).

It's not about being a system administrator, it's about understanding what the things you're installing actually do. You need development packages to develop against, rather than consume, a package. I don't understand the criticism you're making here.

I might be wrong but my mind associates -dev and -devel packages with something that is provided for developers of the package itself, e.g., kernel-devel allows you to compile the kernel. I'm not going to contribute to OpenJDK project so why would I need openjdk-devel package?
Agreed. I find Fedora package naming vastly more consistent and sensible.
Thanks. AFAIR I installed everything related to Java; maybe I made a mistake somewhere. I also tried to fix the problem with "alternatives --config java".