1. Download JavaSDK.
(1) Download JDK
(2) Select the access permission agent in Java SE Development Kit 8u144.
(3) Select the version suitable for your operating system to download.
2. Upload jkd to the linux server.
Use the rz command
rz
3. Unzip the jdk installation package
tar -zxvf compressed file (unzip the installation package to this directory Next)
tar -zxvf compressed file -C Specify directory path (unzip the installation package to the specified directory)
4. Edit the environment variable configuration file
vi /etc/profile
Add three environment variables at the end of the file
export JAVA_HOME=/java/jdk1.8.0_111(改为jdk解压后文件所在目录) export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
5. Make the environment variables take effect
source /etc/profile
The above is the detailed content of How to configure Java environment variables in Linux?. For more information, please follow other related articles on the PHP Chinese website!