Ty Young wrote:
> alternatives(see: https://fedoraproject.org/wiki/Java), which is supposed
> to allow you to switch between Java versions, flat out doesn't work.

This is probably due to limitations in Silverblue. The Fedora Java packaging 
was designed for normal Fedora, at a time where Silverblue did not even 
exist as a concept.

No matter how aggressively Silverblue is being marketed at the moment, it is 
still pretty experimental and inconvenient to use.

You will probably have a much better experience using a standard, non-atomic 
Fedora installation.

> They go to /etc/alternatives. I guess this is supposed to be how
> alternatives finds alternative JRE/JDK installs. Ubuntu doesn't have to do
> this for update-alternatives nor does Arch's archlinux-java script but...
> OK. This is insanely complicated for no real good reason.

The idea is that alternatives should only write to /etc, never to /usr. 
Writing to /usr is a bad idea (and incidentally, will likely never work in 
Silverblue). So the alternatives in /usr must be symlinks to 
/etc/alternatives, and /etc/alternatives contains the user-configurable 
symlinks to the real binaries.

> But wait, we aren't done yet because what's being linked to from
> /usr/lib/jvm isn't a file, it's... another system link. Back to the 3 non
> system links in /usr/lib/jvm which have horrendously long and complex
> folder names. Is calling them
> java-<version>-<jre/jdk>-<oracle/zulu/openjdk> not enough?

The naming allows installing multiple versions of the same major version, 
and in particular also 32-bit vs. 64-bit versions.

> To top this "what" fest off, the JRE/JDK folders in /etc/alternatives
> aren't even named properly.  That is to say,   "jre" is attached to the
> front even if what's being linked is a JDK.

No. If you just install the java-*-openjdk package, you get only the JRE 
part of OpenJDK. The JDK part is in java-*-openjdk-devel.

The way this works is that the -devel package adds:
* files to the versioned directory under /usr/lib/jvm AND
* additional alternatives settings for jdk, javac, etc. (and normally, javac
  inherits the setting for jdk which itself inherits the jre setting, but
  you can force a mixed version mess if you really want that).

> Yes, a JDK contains a JRE but it's still horribly confusing for no good
> reason. Like, imagining if alternatives did work, does it list duplicate
> entries for each JRE/JDK? For example:
> 
> jre_11
> java-11-openjdk
> 
> which(again) system link to the same JDK install.

jre_11 is any Java 11 implementation. java-11-openjdk is any minor version 
of OpenJDK 11, so more specific. Different applications may want to have 
differently stringent requirements. The alternatives are set up to allow 
them to specify exactly what they want.

> What shroom induced insanity is this?

It's not insane, it's complex because there are so many people with so many 
different requirements for Java stuff (and it was designed at a time where 
the situation was even worse, with Sun Java, IBM Java, and the Free as in 
Speech but limited-functionality GCJ stack, which was the best we had in 
Free Software before OpenJDK and IcedTea).

> Why does alternatives not work?

Probably a bug or missing feature in Silverblue.

        Kevin Kofler
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org

Reply via email to