1. Download the jdk file from the official website or other channels: jdk.tar.gz
Attachment: upload and download file commands
upload files
scp yljy.war [email protected]:/usr/app/tomcat-main/webapps/ROOT
scp yljy.war [email protected]:/usr/app/apache-tomcat-8.0.35/webapps/ROOT
Download folder:
scp -r [email protected]:/usr/app/www/yrkdy/ /Users/yangshiyou/Downloads/ROOT
2. Decompress the tar.gz file: tar -zxvf jdk.tar.gz
3. Configure environment variables
a. Edit the file: vi /etc/profile
Attachment: add the following at the bottom of the file:
export JAVA_HOME=/opt/jdk
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
4. Let the environment variable configuration take effect
source /etc/profile