mojira.dev
MCL-10090

Linux Launcher uses system jre instead of Java 8

The launcher uses the system Java runtime, even if Java 8 is installed.

What I expected to happen was...:

The launcher should check if

"/usr/lib/jvm/java-8-oracle/jre/bin/java"

or

"/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"

exists and try to use those before reverting to using "/usr/bin/java" (which is probably going to be Java 10 or 11 on most linux installs).

As an alternative, you could at least inform the player that he is not using an optimal version of java and leave the task of setting the Java executable launch option to the user.

Steps to Reproduce:
1. get a fresh install of linux.
2. run apt install default-jre
3. run apt install openjdk-8-jre
4. install the minecraft launcher from: https://launcher.mojang.com/download/Minecraft.deb
5. the launcher will use Java 11, even though Java 8 would be the better option

Comments 5

Is this still the case? Because I downloaded the latest .deb file onto a freshly-installed Kubuntu 19.04 and I'm having the exact opposite problem: It's refusing to run the installer because of a dependency on either oracle-java8-installer or openjdk-8-jre, neither of which are available anymore because they're obsolete.

I have installed openjdk-8-jre (which will get security updates on 18.04 LTS until 2021: https://blog.ubuntu.com/2019/04/19/announcing-openjdk-11-packages-in-ubuntu-18-04-lts) on my Ubuntu 18.04, so the latest launcher .deb installs fine. But removing openjdk-8-jre indeed also removes minecraft-launcher and installing the .deb also installs openjdk-8-jre again.

The launcher seems to depend on java 8, but the game mostly runs fine with newer versions of java. On most linuxes the launcher also defaults to not even using the installed java 8, because it sets the java executable path to /usr/bin/java.

The most future-proof option would be to improve compatability with newer versions of java and remove the dependency on specific versions of java.

I found that older versions of game doesn't run on newer java versions such as 11, a workaround would be to set java executable in launch options tab to java 8 executable in every configuration that's doesn't run with the current java version.

Use `update-java-alternatives` or equivalent. Setting the default system Java to use is not the launcher's business.

For examples of use of `update-java-alternatives`: https://aboullaite.me/switching-between-java-versions-on-ubuntu-linux/

 

And yes, you can set the java per installation, but that's super annoying if you have many. We should have some global java settings for that.

Hi there!
Could you answer few questions regarding this issue, it will help with the investigation:

  • Does this issue still occurs to you on newest version of Launcher?

  • Has the solution provided by Petr Mrazek fixed your issue?

  • Is your Java up-to-date?

This ticket will automatically reopen when you reply.

Inge Neur

(Unassigned)

Community Consensus

Retrieved