Home > php教程 > PHP开发 > body text

Install JDK on Linux system

高洛峰
Release: 2016-11-15 15:01:36
Original
2030 people have browsed it

1. Upload the JDK installation package to the Linux server
Use the FileZilla tool to upload the jdk Linux installation package to any directory on the server

Install JDK on Linux system

2. Use the SecureCRT tool to connect to the Linux server
Use the SecureCRT tool to connect to the server, and use ls and cd Command to enter the directory where the jdk installation package is located

Install JDK on Linux system

3. Decompress the JDK installation package
Use the tar -zxvf command to decompress the jdk installation package. The command is as follows:
tar -zxvf The full name of the compressed file
tar -zxvf jdk-8u111 -linux-x64.tar.gz

Install JDK on Linux system

4. Enter the system environment variable configuration file
Use the vim /etc/profile command to enter the system environment variable configuration file

Install JDK on Linux system

5. Add JDK environment variables on the Linux server
Press i to enter edit insert mode and add the following code at the bottom
JAVA_HOME=JDK installation directory
JRE_HOME=JDK installation directory/jre
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$JAVA_HOME/bin :$PATH
export PATH CLASSPATH JAVA_HOME
In this example, the JDK installation directory is as follows
JAVA_HOME=/home/zc/programstudio/jdk1.8.0_111
JRE_HOME=/home/zc/programstudio/jdk1.8.0_111/jre
CLASSPATH =$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$JAVA_HOME/bin:$PATH
export PATH CLASSPATH JAVA_HOME
After adding it, press the ESC key to exit the edit insertion mode

Install JDK on Linux system

Then enter the following command: wq and press Enter to exit the edit mode

6. Make the configuration file take effect immediately
Use the source /etc/profile command to make the environment variable configuration just take effect immediately

Install JDK on Linux system

7. Verify whether the installation is complete

Use java -version Command to verify whether the environment variables are configured

Install JDK on Linux system

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!