Install JAVA1 Create normal user Useradd wujianpasswd Wujian prompt for password: "Enter Wujian password" User:wujian group:root passwd:123456789 2 to "Wujian" Assign root permissions vi/etc/sudoers found in file #%wheel all= (All) all remove "#" execution command: usermod-g root wujian Execute command: Su-"note su and-there is a space between" 3 background: if the user Using root to upload the Java installer to the server, the Java installer is bound to be the root of the current user role: Root create installation file folder Directory execution command: CD/USR Execute command: mkdir-p serversoft " Use Xftp to upload the Java installer to Serversoft "The current directory structure is:/usr/serversoft/jdk-8u141-linux-x64.rpm change Serversoft belongs to: Wujian Execute command: chown -R Root.wujian/serversoft "-r: Represents the recursive root.wujian:root for the group, Wujian on behalf of the user" "/serversoft: Represents the folder" this time the file belongs to the user Wujian 4 Go to the Serversoft directory, perform the decompression installation execution command: RPM-IVH JDK-8U141-LINUX-X64.RPM5 set environment variable execution command: Vi/etc/profile "at the bottom of the file" #set Java Environmentjava_home=/usr/java/jdk1.8.0_141classpath=.: $JAVA _home/lib/tools.jarpath= $JAVA _home/bin: $PATHexport Java_home CLASSPATH Path Save exit Execute command: Source/etc/profile6 Verify Installation "Execute the following command sequentially, with normal input OK" echo $JAVA _homeecho $CLASS _pathecho $ Pathjava-version
Installing Java under the CENTOS7 of test service Setup