linux configuration environment jdk linux (Centos7 system) installed in the JDK, Tomcat, Mysql

Conditions: jdk installed, if not installed see here: Linux (Centos7 system) installed JDK, Tomcat, Mysql

Proceed as follows:

linux, the environment variable is modified files in / etc / profile in

vi / etc / profile

If no environment variables, please join in the final environment variable, the following is my path:

After entering the file, press 'i' key, enter the edit state;

JAVA_HOME=/usr/lib/jvm/java-1.8.0
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH

// add the above code, directly or ESC ctrl + C, enter: wq (colon), Enter to save on the line

Then just load the environment variable configuration, the command is as follows:

source   /etc/profile    

JDK verify whether the installation is successful, the command line, enter

java -version   

Enter, if printed out JDK version, OK!

 

Guess you like

Origin www.cnblogs.com/weibanggang/p/11460537.html