jdk版本1.6,1.7,1.8 =以后其他程序员说了版本号6 7 8 其实就是1.6,1.7,1.8 版本 官网下载地址 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html =需要先下载到Windows上面 --下载完成以后可以使用命令sz,rz 把Windows的数据包传送到Linux上面 --或者使用Xftp
区分系统
下载jdk8,放到/usr/local/src/目录下 =今天usl/local/src/目录然后把下载的数据包传送到里面来
tar zxvf jdk-8u144-linux-x64.tar.gz =解压下载的数据包
mv jdk1.8.0_144 /usr/local/jdk1.8 =给解压完成后的数据包更换一个其他目录并且改名
vi /etc/profile //最后面增加 = 编辑/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 = source重启环境变量配置文件
java -version = 检测jdk环境是否配置好
Tomcat 是一个中间节
cd /usr/local/src =下载包存放目录(根据公司需求)
wget http://apache.fayea.com/tomcat/tomcat-8/v8.5.20/bin/apache-tomcat-8.5.20.tar.gz =下载tomcat安装包 安装包失效去(http://apache.fayea.com/tomcat/tomcat-8/v8.0.52/bin/)
tar zxvf apache-tomcat-8.5.20.tar.gz =解压Tomcat安装包
mv apache-tomcat-8.5.20 /usr/local/tomcat =给解压以后的安装包更换一个其他存放目录并且改名(为以后工作需求做统计容易区分)
/usr/local/tomcat/bin/startup.sh =启动Tomcat
ps aux|grep tomcat = 查看Tomcat进程
ps aux | grep java =查看java进程,如果java进程启动那么说明Tomcat就启动成功
[root@aming-01 src]# /usr/local/tomcat/bin/shutdown.sh #关闭tomc
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
[root@aming-01 src]# !ps
ps aux |grep java
root 2145 0.0 0.0 112676 984 pts/0 S+ 20:40 0:00 grep --color=auto java
[root@aming-01 src]# /usr/local/tomcat/bin/startup.sh 启动Tomcat
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/local/jdk1.8
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
Tomcat不支持直接重启,如果更改了配置文件那么需要先关闭Tomcat,然后在启动Tomcat
netstat -lntp |grep java =查看Java监听的端口
三个端口8080为提供web服务的端口,8005为管理端口,8009端口为第三方服务调用的端口,比如httpd和Tomcat结合时会用到
访问测试机