Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | Java: Allow to install specific/multiple Java versions #4505

Open
Camry2731 opened this issue Jun 23, 2021 · 2 comments
Open

Comments

@Camry2731
Copy link

Camry2731 commented Jun 23, 2021

Creating a software request

Is your feature request related to a problem? Please describe:

  • Bringing attention to this issue now before it becomes more of a problem later. As of 1.17 of Minecraft, Java 16 is required or else it will not function. Issue is older versions tend to break or not work entirely with Java 16 and requires either Java 8/11. I believe currently DietPi installs Java 11. This will impact any Java Minecraft program (not bedrock) in the list (PaperMC, MineOS, Cuberite)

Example: Run a 1.17 server in MineOS and nothing will happen

Describe the solution you'd like:

  • Not sure entirely how this should be solved. It could be done by installing both versions of Java, and then providing instructions on the wiki how to specify the version in the various programs. I'd leave Java 11 the default for compatibility reasons, but have Java 16 in the event of Minecraft 1.17.

Note: MineOS's developer Hexparrot has addressed the issue of managing Java versions and will be implementing a webui toggle for it soon, though not sure about the others.

hexparrot/mineos-node#410 (comment)

@Camry2731 Camry2731 changed the title Feature request | Install/allow multiple versions of Java due to changes with Minecraft 1.17 Software request | Install/allow multiple versions of Java due to changes with Minecraft 1.17 Jun 23, 2021
@Camry2731 Camry2731 changed the title Software request | Install/allow multiple versions of Java due to changes with Minecraft 1.17 DietPi-Software | Install/allow multiple versions of Java due to changes with Minecraft 1.17 Jun 23, 2021
@MichaIng
Copy link
Owner

Many thanks for the info.

This is a heavy cut, especially since Minecraft v1.16 supports only Java up to v14 and the next version now requires a min version two major version number higher than the last max version... Not exactly nice for developers of implementations who have to deal with all the user reports about broken compatibility, but they may have their reasons.

In case of MineOS, we can add a hint to our docs that v1.17 does not work unless Java 16 is (for now manually) installed. In case of PaperMC, probably their installer is or will be smart enough to fallback to the latest MC v1.16 when it was not executed with Java 16+. But for Nukkit and Cuberite, as fast as they upgrade their builds, there is currently not really a way to detect it.

We simply install the native Java version shipped by the Debian APT repository, which is Java 8 on Stretch, Java 11 on Buster and it will be Java 17 on Bullseye (currently still Java 11, but Java 17 available, just needs testing).

To enable Minecraft v1.17 on Buster (and Stretch), we could download the zulu JRE builds: http://static.azul.com/zulu/bin/
But they don't ship ARMv6/ARMv7 builds, hence it won't work on RPi 32-bit images.
But there is also AdoptOpenJDK: https://github.com/AdoptOpenJDK/openjdk17-binaries/releases
They ship binaries for 32-bit ARM as well, requires testing if it works also on the ARMv6 RPi models. There is not much issue to install them aside of other Java versions, as each version/build has it's own distinct directory. It get's interesting when you want to have a specific executable in you PATH (so that you can run it from console without using the full path) or set a JAVA_HOME. But I'd skip that completely (to not mess with possibly installed Debian Java packages) and use the full path to the wanted Java executable and JAVA_HOME via systemd service only.

It requires some testing. In case of MineOS, it's good that they implement an option, as the web UI itself runs with Node.js, so we don't have control over which Java executable is used, and I bet JAVA_HOME is not passed through (which would be good).

@MichaIng
Copy link
Owner

MichaIng commented Dec 2, 2021

Just an update on this. I'd highly prefer to use the non-commercial Adoptium Temurin as replacement for the Debian Java packages, if we generally want to implement multiple Java versions into dietpi-software. However, to keep it slim I'd only go that way when there are dedicated JRE builds available, and currently Adoptium does not release those but only the full JDK. There is an ongoing discussion whether to provide JRE releases as well: adoptium/temurin-build#2683
EDIT: JRE builds are available now.

Since we do now ship Bullseye images (providing JRE 17 packages from Debian) for all SBCs and provide a blog about how to upgrade from Stretch => Buster => Bullseye, for Minecraft resp. PaperMC only, I do not see this being of high priority anymore. Cuberite (and most other dedicated Minecraft server implementations) ships an older Minecraft version and in MineOS one can freely select a version that works, and can even download "embedded" Java binaries(?). So in the latter case we may instead add a note to our docs, which version to select for which Debian version for now.

But there are other software titles with specific Java version requirements, so I see there is some benefit to have more software available on more Debian versions. However, I'll detach this from milestones until there are more related reports/requests.

@MichaIng MichaIng changed the title DietPi-Software | Install/allow multiple versions of Java due to changes with Minecraft 1.17 DietPi-Software | Java: Allow to install specific/multiple Java versions Dec 2, 2021
@MichaIng MichaIng removed this from the v7.9 milestone Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants