• 欢迎访问运维搬运工网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 本站一年会员:100元 ,两年会员:180元 ,永久会员:380元
  • 这世界就是,一些人总在昼夜不停地运转,而另外一些人,起床就发现世界已经变了。
  • 本博客推广的是知识付费,用赞助的方式实现博客维护,不以赚钱为目的的博客

源码安装jdk1.8和tomcat8.5

下载jdk

 

安装jdk

[root@iZj6cffp8anaguadrxuwx8Z ~]# cd /usr/local/src/

[root@iZj6cffp8anaguadrxuwx8Z src]# tar -xvf jdk-8u191-linux-x64.tar.gz

[root@iZj6cffp8anaguadrxuwx8Z src]# mkdir -p /usr/java
[root@iZj6cffp8anaguadrxuwx8Z src]# mv jdk
jdk1.8.0_191/ jdk-8u191-linux-x64.tar.gz 
[root@iZj6cffp8anaguadrxuwx8Z src]# mv jdk1.8.0_191/ /usr/java/

[root@iZj6cffp8anaguadrxuwx8Z src]# cd /usr/java/
[root@iZj6cffp8anaguadrxuwx8Z java]# ln -s /usr/java/jdk1.8.0_191/ /usr/java/latest
[root@iZj6cffp8anaguadrxuwx8Z java]# ln -s /usr/java/latest/ /usr/java/default

环境变量

echo '#!/bin/sh' >>/etc/profile.d/java.sh
echo "# This is JAVA profile by zhaoshuai in $(date +%F)." >>/etc/profile.d/java.sh
echo 'export JAVA_HOME=/usr/java/latest' >>/etc/profile.d/java.sh
echo 'export JRE_HOME=/usr/java/latest/jre' >>/etc/profile.d/java.sh
echo 'export CLASSPATH=$JAVA_HOME/lib/:$JRE_HOME/lib' >>/etc/profile.d/java.sh
echo 'export PATH=$JAVA_HOME/bin:$PATH' >>/etc/profile.d/java.sh
cat /etc/profile.d/java.sh
source /etc/profile.d/java.sh

检查

[root@iZj6cffp8anaguadrxuwx8Z java]# java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

安装tomcat

 

 

解压

[root@iZj6cffp8anaguadrxuwx8Z src]# tar -zxf apache-tomcat-8.5.37.tar.gz 
[root@iZj6cffp8anaguadrxuwx8Z src]# mv apache-tomcat-8.5.37 /usr/local/tomcat

启动

[root@iZj6cffp8anaguadrxuwx8Z ~]# /usr/local/tomcat/bin/catalina.sh start 
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/latest/jre
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@iZj6cffp8anaguadrxuwx8Z ~]# ps -ef |grep --color=auto tomcat
root 11255 1 18 12:18 pts/0 00:00:01 /usr/java/latest/jre/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 11273 28820 0 12:18 pts/0 00:00:00 grep --color=auto --color=auto tomcat
[root@iZj6cffp8anaguadrxuwx8Z ~]# tail -f /usr/local/tomcat/logs/catalina.out 
24-Dec-2018 12:18:19.377 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
24-Dec-2018 12:18:19.377 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
24-Dec-2018 12:18:19.663 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
24-Dec-2018 12:18:19.686 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Dec-2018 12:18:19.714 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
24-Dec-2018 12:18:19.715 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read

 


运维搬运工 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:源码安装jdk1.8和tomcat8.5
喜欢 (0)
[扫描二维码]
分享 (0)
大自然搬运工
关于作者:
不是路不平,而是你不行。到底行不行,看你停不停。只要你不停,早晚都能行。
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址