zoukankan      html  css  js  c++  java
  • 怎么部署java项目(从搭建环境说起)

    1、服务器需要安装对应开发版本的jdk

    在官网下载jdk对应的jdk版本,解压到某个目录下如:

    root@guchen-ubuntu16-04lts:/home/guchen/usr/java# ls
    jdk1.8.0_111  jdk-8u111-linux-x64.tar.gz

    解压命令 tar -xzvf jdk-8u111-linux-x64.tar.gz

    2.进入 vi /etc/profile 中添加环境变量如下:

    1 #jdk1.8.0._111
    2 JAVA_HOME=/home/guchen/usr/java/jdk1.8.0_111
    3 JRE_HOME=/home/guchen/usr/java/jdk1.8.0_111/jre
    4 MAVEN_HOME=/home/guchen/usr/local/apache-maven-3.3.9
    5 PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$MAVEN_HOME/bin
    6 CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
    7 export JAVA_HOME JRE_HOME MAVEN_HOME PATH CLASSPATH

    保存退出后使环境变量生效,执行:source /etc/profile

    3、安装tomcat

    下载tomcat,并解压到某个目录下如:

    root@guchen-ubuntu16-04lts:/home/guchen/usr/local# ls
    apache-maven-3.3.9  apache-maven-3.3.9-bin.tar.gz  apache-tomcat-7.0.72  apache-tomcat-7.0.72.tar.gz

    4、把war包放进webapps下面重启tomcat就ok啦

    root@guchen-ubuntu16-04lts:/home/guchen/usr/local/apache-tomcat-7.0.72/webapps# ls
    docs  examples  host-manager  jenkins  jenkins.war  manager  operation-centre  operation-centre.war  ROOT

    进入到bin目录下重启tomcat,执行命令 ./startup.sh

    root@guchen-ubuntu16-04lts:/home/guchen/usr/local/apache-tomcat-7.0.72/bin# ./startup.sh 
    Using CATALINA_BASE:   /home/guchen/usr/local/apache-tomcat-7.0.72
    Using CATALINA_HOME:   /home/guchen/usr/local/apache-tomcat-7.0.72
    Using CATALINA_TMPDIR: /home/guchen/usr/local/apache-tomcat-7.0.72/temp
    Using JRE_HOME:        /home/guchen/usr/java/jdk1.8.0_111/jre
    Using CLASSPATH:       /home/guchen/usr/local/apache-tomcat-7.0.72/bin/bootstrap.jar:/home/guchen/usr/local/apache-tomcat-7.0.72/bin/tomcat-juli.jar
    Tomcat started.
    root@guchen-ubuntu16-04lts:/home/guchen/usr/local/apache-tomcat-7.0.72/bin#

    网址输入IP:8080

    如果出现tomcat首页则说明安装ok

  • 相关阅读:
    ListView 操作
    Delphi 浏览器WebBrowser
    XE6 c++builder Edit垂直居中
    HTML 表格标签
    HTML 标签说明
    Ubuntu下如何解压缩zip,tar,tar.gz,tar.bz2文件
    Ubuntu 12.04下mysql的安装与配置
    Ubuntu12.04下apache服务器的安装也配置
    Ubuntu12.04下tomcat的安装与配置
    Ubuntu 12.04下jdk的安装与配置
  • 原文地址:https://www.cnblogs.com/gcgc/p/5996050.html
Copyright © 2011-2022 走看看