Install JDK under Linux

share a drink no 2022-11-24 21:17:29 阅读数:669

installjdklinux

JDK download address: https://www.oracle.com/java/technologies/downloads/archive/ Create installation directory

mkdir /usr/local/src/java

Upload the jdk tar package to the directory and decompress it

tar -xvf jdk-7u71-linux-i586.tar.gz

Configure environment variables:

① vi /etc/profile② Add at the end line#set java environmentJAVA_HOME=/usr/local/src/java/jdk1.7.0_71CLASSPATH=.:$JAVA_HOME/lib.tools.jarPATH=$JAVA_HOME/bin:$PATHexport JAVA_HOME CLASSPATH PATH

Save and exit ③source /etc/profile to make the changed configuration take effect immediately ④java -version Check the JDK version information, if it shows 1.7.0 proves success

copyright:author[share a drink no],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/328/202211242108078125.html