hellopasswd
Tomcat介绍
- Tomcat是Apache软件基金会(Apache Software Foundation)的Jackarta项目中的一个核心项目,由Apache、Sun和其他一些公司及个人共同开发而成。
- Java程序写的网站用tomcat+jdk来运行
- tomcat是一个中间件,真正起作用的,解析java脚本的是jdk
- jdk(Java development kit)是整个java的可信,它包含了Java运行环境和一堆Java相关的工具以及java基础库。
- 最主流的jdk为sun公司发布的jdk,除此之外,其实IBM公司也有发布jdk,CentOS上也可以用yum安装openjdk
安装jdk
- jdk版本1.6、1.7、1.8
- 官网下载地址
- 下载jdk8,放到/usr/local/src目录下
- tar zxvf jdk-8u161-linux-x64.gz
- mv jdk1.8.0_161 /usr/local/jdk1.8
- vi /etc/profile JAVA_HOME=/usr/local/jdk1.8 JAVA_BIN=/usr/local/jdk1.8/bin JRE_HOME=/usr/local/jdk1.8/jre PATH=¥PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin CLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.jar
- source /etc/profile
- java -version
安装jdk
[root@localhost ~]# cd /usr/local/src/[root@localhost src]# yum -y install lrzszLoaded plugins: fastestmirrorbase | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 updates/7/x86_64/primary_db | 5.2 MB 00:00:01 Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: mirrors.aliyun.comResolving Dependencies--> Running transaction check---> Package lrzsz.x86_64 0:0.12.20-36.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================================================================ Package Arch Version Repository Size================================================================================================================================Installing: lrzsz x86_64 0.12.20-36.el7 base 78 kTransaction Summary================================================================================================================================Install 1 PackageTotal download size: 78 kInstalled size: 181 kDownloading packages:lrzsz-0.12.20-36.el7.x86_64.rpm | 78 kB 00:00:00 Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing : lrzsz-0.12.20-36.el7.x86_64 1/1 Verifying : lrzsz-0.12.20-36.el7.x86_64 1/1 Installed: lrzsz.x86_64 0:0.12.20-36.el7 Complete![root@localhost src]# rz[root@localhost src]# tar zxvf jdk-8u161-linux-x64.gz[root@localhost src]# lsjdk1.8.0_161 jdk-8u161-linux-x64.gz[root@localhost src]# mv jdk1.8.0_161/ /usr/local/jdk1.8/
添加环境变量
[root@localhost src]# vi /etc/profile添加 78 JAVA_HOME=/usr/local/jdk1.8/ 79 JAVA_BIN=/usr/local/jdk1.8/bin 80 JRE_HOME=/usr/local/jdk1.8/jre 81 PATH=$PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin 82 CLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.jar
为
[root@localhost src]# vi /etc/profile 75 unset i 76 unset -f pathmunge 77 78 JAVA_HOME=/usr/local/jdk1.8/ 79 JAVA_BIN=/usr/local/jdk1.8/bin 80 JRE_HOME=/usr/local/jdk1.8/jre 81 PATH=$PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin 82 CLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.jar[root@localhost src]# source /etc/profile
检验java
[root@localhost src]# java -version java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
修改于 180120