Hacker News new | ask | show | jobs
by gepi79 2783 days ago
I switched from Fedora 28 to Ubuntu because I could not make my IDE (IntelliJ, Netbeans, maybe Eclipse too) recognize the installed Fedora JDK (no valid JDK found). It seems that this has been a common problem for years.
2 comments

If it couldn't find a JDK, it usually means you didn't install the appropriate `-devel` package. (This is consistent across RHEL derivatives.)
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.

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".
This is a fairly trivial problem to work around, although maybe this should be one of those "sane default" kind of things. Set the environment variable JAVA_HOME=/etc/alternatives/jre or point it at the specific OpenJDK version you want. That's what /etc/alternatives is for.
Thanks for the solution. Although I have no Fedora anymore to check.