CHANGE
JAVA
VERSION
Just reminders to myself — like the day I needed to check which Java versions were installed on my machine and realized I also had to switch between them. Little things like that end up here, alongside the bigger lessons I pick up as a backend developer.
How to solve?
Linux.
sudo update-alternatives --config java
or
nano ~/.bashrc
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-17.0.8.0.7-2.el8.x86_64"
export PATH=$JAVA_HOME/bin:$PATH
source ~/.bashrc
Mac OS.
/usr/libexec/java_home -V
then
export JAVA_HOME=`/usr/libexec/java_home -v 17.0.4`