Download the jdk tar package. Assume that the directory where the tar package is located is /home/username/Download. Use Use the following command to decompress the tar package
tar -zxf /home/username/Download/jdk-8u77-linux-x64.tar.gz
After decompression is completed, move the decompressed package to the installation directory, assuming it is /home/username/develop
mv jdk1.8.0.7 /home/username/develop
For the convenience of operation, rename the jdk installation directory. Enter the develop directory
mv jdk1.8.0.7 jdk
Edit the .bashrc file in the username directory, that is /home/username/.bashrc, the command is
vim /home/username/.bashrc
Add the following to the beginning of the .bashrc file:
export JAVA_HOME=/home/username/develop/jdk
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source /home/username/.bashrc
The above is the detailed content of About the installation and configuration method of jdk in Ubuntu system. For more information, please follow other related articles on the PHP Chinese website!