vim ~/.bashrc
export JAVA_HOME=/home/wy/java/jdk-17.0.2
export JRE_HOME=/home/wy/java/jdk-17.0.2/jre
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
source ~/.bashrc
sudo update-alternatives --install /usr/bin/java java /home/wy/java/jdk-17.0.2/bin/java 300
java -version