code icon indicating copy to clipboard operation
code copied to clipboard

Missing correct Java installation (+ Add Java 16 custom PATH option, + Incompatible Mods Found in Minecraft 1.17)

Open HGStyle opened this issue 10 months ago • 1 comments

Describe the bug

I just updated my Modrinth Launcher to v0.7.1 and whenether I launch any Minecraft 1.17.1 (my favorite version) instance/profile I have, it returns this error. I never changed my settings, but just in case, I checked them and everything seems fine. But when launching a 1.20 instance like Simply Optimized, it seems to work perfectly fine. Here are my Java settings, seeming to be correct:

image

Steps to reproduce

  1. Run any Minecraft 1.17 instance that you installed before doing the update
  2. Get the error

Expected behavior

Well, it should launch Minecraft since before the update everything worked fine.

System information

I'm running Modrinth v0.7.1 on Windows 11.

What's wrong

I tried to figure out what's wrong with Modrinth so I tried to download and run Minecraft 1.17 (which I didn't downloaded) and I got surprised that Modrinth downloads Java 16 on its own. Note that I preferto manage the Java instances myself, so I would really like that Modrinth has an option to set the Java 16 executable path as it's the case for LTS Java versions (8, 17 and 21).

How to fix (for users)

Just install any 1.17 version you never installed from the Modrinth launcher and it'll download Java 16, now you can, if you want, remove the instance you just installed and launch any 1.17 instance you want.

Notes

I tested some versions of Minecraft with this "bug" including: Vanilla 1.8.9, Fabric 1.16.5, Fabric 1.17, Fabric 1.17.1, Fabric 1.20.4 and only Fabric 1.17 and Fabric 1.17.1 had the bug, so I conclude (without testing a lot of other versions) that it's a Minecraft 1.17 problem.

HGStyle avatar Apr 24 '24 14:04 HGStyle

How to change Java 16 path (Windows only, cuz I only use Modrinth on Windows)

Make sure that Modrinth is closed before doing this !

Open with a code editor (like Visual Studio Code or the default Notepad if you don't have any code editor) the file settings.json that's in this folder: %appdata%\com.modrinth.theseus (to open the folder, press the Windows key and the R key at the same time and put this text in the inputbox then validate by the run button).

Use the Search option of the editor to search for JAVA_16 (do Control+F to open the search dialog or Edit > Search on most code editor including Notepad), then you'll find something like this:

image

Now replace the path that comes after the JAVA_16 by the Java 16 path you want, in my case: C:\\Program Files\\BellSoft\\LibericaJDK-16\\bin\\javaw.exe and then save the file by Control+S or File > Save. Then you can reopen Modrinth.

Notes:

  • Make sure the path points to a valid file
  • Make sure to double the backslashes (\) in the path (\\)
  • Make sure to not remove any quotes (")
  • Make sure the file that the path points to is not java.exe but rather javaw.exe (notice the W).

If you get an Incompatible Mods error

Like this:

image

Do again the same steps but replace the Java 16 path by the Java 17 path. This should fix the problem (as some mods requires Java 17 but Modrinth now seems to forces to use Java 16).

HGStyle avatar Apr 24 '24 14:04 HGStyle