CentOS基本配置
软件更新:yum upgrade -y (-y:安装过程中的默认项选y)
自动补全命令:yum -y install bash-completion
Wget下载软件的工具:yum install -y wget
安装vim编辑工具:yum install -y vim-enhanced
安装网络工具:yum install -y net-tools.x86_64
安装java环境:
(1)下载jdk包,把包移动到/opt/software(software是自己创建的目录)
(2)把软件包解压在/usr/local/src目录下
(3)编辑配置文件:vim /etc/profile,在行末尾追加这四行
export JAVA_HOME=/usr/local/src/jdk1.8.0_291
export JRE_HOME=/usr/local/src/jdk1.8.0_291/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$PATH
(4)使配置文件生效:source /etc/profile
(5)测试版本号:java -version,会返回以下三行,说明安装成功
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)