环境
操作系统:CentOS Linux release 8.0.1905
数据库:mariadb10.3.17
安装数据库
yum install -y mariadb mariadb-server
systemctl start mariadb
mysql_secure_installation
mysql -uroot -p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
解压tar包
tar -xzvf jdk-8u212-linux-x64.tar.gz
安装java
vim /etc/profile
末尾添加:
JAVA_HOME=/usr/local/java/jdk1.8.0_221
JRE_HOME=/usr/local/java/jdk1.8.0_221/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH
source /etc/profile
运行jar包
nohup java -jar printer.jar >> printer.log 2>&1 &