top | item 46076712

(no title)

rimmontrieu | 3 months 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

discuss

order

layer8|3 months ago

JDKs 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|3 months ago

The 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/