I use Manjaro operating system I have installed OpenJDK version 11 and 18 (version 11 is installed first) and when I type java --version command in terminal it shows version 11.
java --version
openjdk 11.0.15 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+3)
OpenJDK 64-Bit Server VM (build 11.0.15+3, mixed mode)
How should I change the default Java version? Is it possible to install update-alternatives on Manjaro?
archlinux-java fix
that fixes default Java environment configuration. Should be run withsudo
though. – Satiable