A simple script to allow to switch easily between JDK versions on a single machine, in case several versions are needed.
Usage:
jver list # list all available versions in $BASE_DIR
jver 17 # switch to version 17
jver 17 -q # suppress output
jver # output current version
Version is persisted on the user home directory.
To use, put the file somewhere, and load it with source /path/to/jver.sh
in your .bashrc
file (or other file depending on your terminal environment). jver
is a function in that file.