Skip to content

Instantly share code, notes, and snippets.

@Postrediori
Created February 4, 2024 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Postrediori/1478e26426be1e96ff11a2824a63209e to your computer and use it in GitHub Desktop.
Save Postrediori/1478e26426be1e96ff11a2824a63209e to your computer and use it in GitHub Desktop.
Java HowTos

Java HowTos

Switch between multiple Java versions in Linux

Use

sudo update-alternatives --config java

which lists all installed versions with current active one marked and provides dialog to switch:

There are 3 choices for the alternative java (providing /usr/bin/java).

Selection    Path...
------------------------------------------------------------
+ 1           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-1.fc35.x86_64/bin/java)
  2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-1.fc35.x86_64/jre/bin/java)
  3           java-latest-openjdk.x86_64 (/usr/lib/jvm/java-17-openjdk-17.0.1.0.12-1.rolling.fc35.x86_64/bin/java)

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment