Install JDK in Linux
- Add jdk8.0_161, I put it in the /data/jdk/dk8.0_161 directory
- Add in the /etc/profile file
JAVA_HOME=/data/jdk/jdk1.8.0_161
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
- Execute source /etc/profile
- Perform java -version verification
Install docker in Linux
Prerequisites
- The kernel version of the CentOS system is higher than 3.10
- CentOS version is 7 and above (64-bit)
Installation process
- Upload the rpm file to the linux machine (I put it in the /home/user directory)
- Execute the command yum install --y /home/user/docker*.rpm
- Execute the command systemctl start docker to start the container
- Execute the command systemctl status docker to view the status of the container
Linux write script to set boot up automatically
- Create a new test.service file under /etc/system/system
- The content of test.service is as follows
[Unit]
Description=test service
[Service]
ExecStart=/home/user/ljb/shell-script/test.sh #The directory where the startup script is located
[Install]
WantedBy=multi-user.target
- Execute systemctl list-unit-files | grep test.service to check whether the system service is recognized
- Execute the command systemctl start test.service to start the system service
- Execute the command systemctl enable test.service to set the service to start automatically after booting