由于项目对jdk 8支持不好,要换成jdk7
----------------------------------------------------------------------------------
对于.tar.gz格式的文件,linux对其进行安装、解压使用 tar -zxvf 命令
对于.bin格式的文件,linux对其进行安装、解压使用 ./ 命令
对于linux中的可执行文件,如果我们需要运行它,也是使用的 ./ 命令
过程记录如下:
1: 下载并解压缩jdk
[root@AY140518225150152f97Z local]# tar -zxvf jdk-7u67-linux-x64.tar.gz
....
jdk1.7.0_67/include/jvmticmlr.h
jdk1.7.0_67/include/classfile_constants.h
[root@AY140518225150152f97Z local]# ls
aegis etc include jdk1.8.0_05 lib libexec nginx-1.7.1 sbin src tomcat-8.0.8-1
bin games jdk1.7.0_67 jdk-7u67-linux-x64.tar.gz lib64 nginx pcre-8.35 share tomcat tomcat-8.0.8-2
2:删除安装包
[root@AY140518225150152f97Z local]# rm -f jdk-7u67-linux-x64.tar.gz
[root@AY140518225150152f97Z local]# ls
aegis etc include jdk1.8.0_05 lib64 nginx pcre-8.35 share tomcat tomcat-8.0.8-2
bin games jdk1.7.0_67 lib libexec nginx-1.7.1 sbin src tomcat-8.0.8-1
[root@AY140518225150152f97Z local]# cd jdk1.7*
[root@AY140518225150152f97Z jdk1.7.0_67]# pwd
/usr/local/jdk1.7.0_67
3:修改环境变量
[root@AY140518225150152f97Z jdk1.7.0_67]# vi /etc/profile
4:验证
[root@AY140518225150152f97Z jdk1.7.0_67]# java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
#设置环境变量修改有效
[root@AY140518225150152f97Z jdk1.7.0_67]#
source /etc/profile
[root@AY140518225150152f97Z jdk1.7.0_67]# java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
Kill failed: $CATALINA_PID not set