First install the java environment
Download the installation package:jdk-19_linux-x64_bin.tar.gz_Free high-speed download | Baidu Netdisk-Unlimited sharing (baidu.com)
Upload the installation package to the virtual machine
Decompress
tar zxvf jdk-19_linux-x64_bin.tar.gz
Move files to
mv jdk-19.0.1 /usr/jdk-19.0.1
Edit configuration file
vim /etc/profile
export JAVA_HOME=/usr/jdk-19.0.1
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
Let the configuration take effect
source /etc/profile
Verify installation