I'm having trouble with my Java version while trying to use a new mod loader for Minecraft. I've downloaded OpenJDK 25 but my system still shows Java 21 when I check with "java --version". I tried using the command "sudo update-alternatives --config java" as well as "sudo update-alternatives --config javac" to select JDK 25, but it still isn't updating. I even restarted the terminal and the machine. Any advice on how to properly change the Java version?
5 Answers
You might want to check if your package manager can help you with Java installs instead of downloading from random sites. Some users found that using tools like "Prism" can help manage Java runtimes more smoothly. Just a thought!
Good point! Just a heads up, Linux Mint runs on Ubuntu, so don’t hesitate to check out Ubuntu’s docs for additional help. They can often solve similar issues!
Before stressing too much, just restart your machine again. Sometimes it helps to kick things into gear. Seems simple but it could just be a hiccup.
Yeah, I tried that first too, and sadly it just didn't fix the issue for me. Wish it were that easy!
If nothing else works, consider removing all Java versions and starting fresh with a clean install of JDK 25. Some people have also recommended using SDKMan to manage Java versions more effectively, which could be worth a shot!
SDKMan is a lifesaver! It's especially great if you're mainly using Java for something like Minecraft – it makes switching between versions super easy.
You might want to try "update-java-alternatives" if it's available. This can help you manage Java versions properly. Just ensure you call it with "--set" so that it links the right version. If that doesn't work, you can manually set the path in your .bashrc file.

True! Prism makes it super easy to download the correct runtimes if they're missing. Plus, it handles all the updates.