Installing Java in 2025, and Version Managers
11–20 of 65 posts
Re: Installing Java in 2025, and Version Managers
#12Earlier quoted context omitted.
Never understood why you’d use sdkman for Java. I just do: 1. brew install openjdk@ 2. ln -s 3. /libexec/java_home -v Afaik, with some aliases in you *shrc it basically reimplements sdkman, what else does it give you?
This works if all you need is OpenJDK. Per the article, sdkman allows one to install and switch between different versions and brands of JDKs.
OK but what benefit does that give? I hope we're not back to the bad old days of different apps needing different brands of JDK to run on.
Re: Installing Java in 2025, and Version Managers
#13On macOS I wrote my own 9-line Zsh function that lists the JDKs available and sets JAVA_HOME.
In containers you'll never switch at all, just install whatever you want and be done with it.
ETA: I see in another comment someone said this doesn't work for things that aren't OpenJDK. But I've yet to run into a situation where I'd want to install anything except OpenJDK. That said, I think update-java-alternatives would work with them if they provide deb files to install themselves.
Re: Installing Java in 2025, and Version Managers
#14Before even deciding which Java to install, you have to decide which _version managers_ to use: 1. No version manager, download and install manually. Not that hard, since it's just a zip file and maybe set JAVA_HOME envvar. If you need multiple versions to co-exist, skip this. 2. Use OS' "native" package manager. Brew, apt, chocolatey. 3. Generic package manager like asdf. 4. SDKMAN!, JBang, jEnv, jabba... Deciding i…
Re: Installing Java in 2025, and Version Managers
#15Re: Installing Java in 2025, and Version Managers
#16First of all, multiple vendors has always been a thing in Java since the early 2000's.
Second, configuring a couple of environment variables isn't that much of a challenge.
Third, all IDEs have an option to use a bundled JVM, and allow for JVM selection per project.
Finally, for applications the modern way is to build the runtime alongside the application, or AOT compilation.
Re: Installing Java in 2025, and Version Managers
#17Earlier quoted context omitted.
This works if all you need is OpenJDK. Per the article, sdkman allows one to install and switch between different versions and brands of JDKs.
> Per the article, sdkman allows one to install and switch between different versions and brands of JDKs. OK but what benefit does that give? I hope we're not back to the bad old days of different apps needing different brands of JDK to run on.
Re: Installing Java in 2025, and Version Managers
#18pro tip: don't bother with SDKMAN. use https://mise.jdx.dev to install Java, it can also install a bunch of other languages and tools. it's most likely the last tool version manager you'll ever need.
And sdkman is written in rust and only needs curl, zip and unzip, no JVM.
Re: Installing Java in 2025, and Version Managers
#19pro tip: don't bother with SDKMAN. use https://mise.jdx.dev to install Java, it can also install a bunch of other languages and tools. it's most likely the last tool version manager you'll ever need.
I found the documentation confusing and as so often with general-approach tools too overwhelming for what I'm trying to do. sdkman works fine for what I need it for and usually you only need one instance of gradle and maven installed. And sdkman is written in rust and only needs curl, zip and unzip, no JVM.
`mise ls-remote java` to show all vendors and versions, or just `mise latest java@temurin` (or any other vendor) to get the latest version string
`mise use -g java@` to install it and set it as a default
Re: Installing Java in 2025, and Version Managers
#20Earlier quoted context omitted.
> Per the article, sdkman allows one to install and switch between different versions and brands of JDKs. OK but what benefit does that give? I hope we're not back to the bad old days of different apps needing different brands of JDK to run on.
It's really handy for switching between projects that are on different Java versions, plus tools like IntelliJ pick up on the correct version via the SDKMAN! configuration as well.