3 ms·
+1 sdkman! is awesome. I've been using sdkman! for a decade to manage Java installations. Doesn't seem to work on freebsd though, which I have to use freebsd's
by rimmontrieu 10mo ago
+1 sdkman! is awesome. I've been using sdkman! for a decade to manage Java installations. Doesn't seem to work on freebsd though, which I have to use freebsd's pkg instead.
On Windows, the only sane way to install Java seems to be scoop.sh or chocolatey
- layer8 10mo agoJDKs are just a directory tree. Not sure what you mean on Windows, you simply unpack the JDKs to whatever directories you want, and set PATH and/or JAVA_HOME according to which you want to use, and/or switch them in your IDE.
- rimmontrieu 10mo agoThe advantage of using a package manager like scoop or chocolatey is that you have a unified interface to manage multiple versions of JDK, and you can switch the default version system-wide on the fly, regardless of your IDE: scoop bucket add java # Install JDK 11 scoop install java/temurin11-jdk # Install JDK 17 scoop install java/temurin17-jdk # Use JDK 11 scoop reset temurin11-jdk # Use JDK 17 scoop reset temurin17-jdk I also wrote a short guide on my website: https://raizensoft.com/tutorial/install-java-gamedev/ https://raizensoft.com/tutorial/install-java-gamedev/
- layer8 10mo agoThanks, but what does “the default version system-wide” mean, other than setting environment variables or replacing the JDK in a fixed location?
- rimmontrieu 10mo agoYou can do that manually but it's tedious if you want to use multiple JDKs. Assuming you want to test two apps outside of an IDE, one only supports Java 8 API, and the other supports Java 21 API, you don't want to edit JAVA_HOME every time you switch back and forth between the two apps. With scoop you can just launch the terminal and run `scoop reset [java-version]`