MultiMC / Launcher

A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once
https://multimc.org/
Other
4.32k stars 883 forks source link

Doesn't detect JDKs installed via sdkman. #4153

Open K0-RR opened 3 years ago

K0-RR commented 3 years ago

Operating System

Linux

Description of bug

Additionally, I think this file lacks some code for the detection of Sapmachine JDK so I added a comment here. https://github.com/MultiMC/MultiMC5/blob/fca2e9e44cb44004eec7f47c03b186bd5e44dc32/launcher/java/JavaUtils.cpp#L238

Steps to reproduce

Suspected cause

The path where sdkman provided java can be found is ~/.sdkman/candidates/java/ (~/.sdkman/candidates/java/17.0.0-librca/bin/java).

This issue is unique

peterix commented 3 years ago

SAP maintaining a fork of JDK ... oh my. That's two corporations having a weird baby.

I think everyone shipping their own version of Java is a massive mistake. This is just further proof of it.

Vanilla Minecraft is tested only with builds shipped by Mojang.

We can add more detection code for this weird stuff, but ultimately, it's the Mojang JRE/JDKs that should be used.

phit commented 3 years ago

note the lines you linked and commented on are for Windows, the paths for their Windows installer are SOFTWARE\\SapMachine\\JRE but I think adding more and more obscure vendors is getting stupid

for linux there isn't really any vendor specific scanning, and I don't really think it's needed https://github.com/MultiMC/MultiMC5/blob/fca2e9e44cb44004eec7f47c03b186bd5e44dc32/launcher/java/JavaUtils.cpp#L386-L394

ImperatorStorm commented 3 years ago

sdkman jvms are typically placed in ~/.sdkman/candidates/java/, which isn't scanned by MultiMC, which is the issue here if i read correctly.

Janrupf commented 3 years ago

Scanning JDK's from sdkman might actually be useful. On some Linux distributions its a major inconvenience to manage multiple JDK installations. Sdkman usually helps in this case, and since its a single function call in the MultiMC code, it should be fine.

To make this clear, the proposed behavior is not specific to any SAP JDK. but the way sdkman installs its software.

schmensch commented 3 years ago

afaik on Linux it just looks for java installs in /lib and /opt.