转载请注明出处: http://qiudeqing.com/java_web/2017/12/28/imooc-ssm-mall.html

环境学习

视频地址

centos软件源配置

阿里云帮助: http://mirrors.aliyun.com/help/centos

  1. 备份
  2. 下载新的CentOS-Base.repo/etc/yum.repos.d/
  3. 运行``生成缓存
      mv mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
      curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
      yum makecache
    

查看centos是32位还是64位

uname -a

centos 安装oracle java 8

rpm vs yum

  1. 清理系统默认自带jdk:rpm -qa | grep jdk查看自带的jdk,执行sudo yum remove xxx
  2. 切换到需要保存安装包的目录如根目录下载jre rpm包
  3. 安装到本地,通常目录为/usr/java/jdk1.8.xxx_xx/jre/bin/java并连接到/usr/bin/java
  cd ~

  wget --no-cookies --no-check-certificate \
  --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
  "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.rpm"

  rpm -ivh jdk-8u151-linux-x64.rpm
  rm ~/jdk-8u151-linux-x64.rpm

  1. 配置jdk环境变量vim /etc/profile,添加
  export JAVA_HOME=/usr/java/jdk1.8.0_151
  export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
  export PATH=$PATH:$JAVA_HOME/bin
  1. source /etc/profile生效

视频地址