centos jdk installation character interface, restart and shut down

jdk uninstall
rpm -qa | grep java
rpm -qa | grep jdk


online install jdk
yum -y list java* find java related list
yum -y install java-1.6.0-openjdk* install the jdk version that can be installed in the list
yum -y remove java-1.6.0-openjdk*Remove the relevant java version

Ordinary installation
   tar -zxvf jdk installation package.tar.gz(zip) -C target path (/usr/java)
 
   backup cp /etc/profile /etc/ Edit profile_dump
   , add the following code at the end
   JAVA_HOME=/usr/java/jdk1.7.0_71
   PATH=$JAVA_HOME/bin:$PATH
   CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
   export PATH JAVA_HOME CLASSPATH
  
   source /etc/profile takes effect
    java -version (other users need to log in again)

init 0/6 Automatic shutdown,
restart enter the character interface by default /etc/initab 3

centos7
# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5
systemctl set-default multi-user.target
systemctl get-default-----View the current system startup mode

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326817416&siteId=291194637