How to configure the environment variables in linux environment

jdk Download:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Configuration software directory in the root directory of the same level in the linux environment

The upload software downloaded jdk folder inside

(I use the operating software)

Under software to this directory.

Enter the command: cd / software

Enter the command: ll

We can see our jdk package

Third, unzip the file

Unzip command xzvf jdk-8u111-linux-x64.tar.gz tar

After unpacking incoming transmission can be deleted before the archive

Delete files rm -f jdk-8u111-linux-x64.tar.gz

5, configure the environment variables jdk

JDK configuration similar to the Windows environment variables need to configure three

After vi / etc / profile enter the letter a or i to enter the edit mode, to add the following variables in the file

Enter the command to add environment variables:

export JAVA_HOME=/software/jdk1.8.0_111
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$PATH

 

Enter the command to view environment variables:

echo $CLASSPATH

echo $PATH

Enter the command to check the version of jdk

 java -version

 

Note: Sometimes we can see the need to restart the configuration information.

 

Guess you like

Origin www.cnblogs.com/qingmuchuanqi48/p/11012789.html