Tomcat手动启动/部署[非安装版]

Tomcat手动启动/部署[非安装版]

写在前面的话:
以前做JavaWeb开发时习惯了,用Eclipse或者Idea等开发工具开发,调试代码. 基本上以来工具的Tomcat插件就很方便的实现了项目的发布/启动.

后来, 想自己写一些静态页面时,不知道如何手动去部署/启动Tomcat,网上找了下,似乎不是那么容易找到.这里自己备注一下, 以便下次查阅.

*确保自己JDK已经安装好, 即已经配置好Java环境, 验证是否已安装:命令窗口执行:java -version 可成功执行,显示自己安装JDK的版本即表示已配置java环境.

  • 将自己要部署的项目打成war包/静态页面,将war包/静态页面放置在tomcat的webapps包下面
    …\Apache\Tomcat\apache-tomcat-7.0.64\webapps
    类似这样的目录下

然后找到bin目录下startup.bat,并编辑,加入:set JAVA_HOME=H:\Program Files\java\jdk1.8

@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License.  You may obtain a copy of the License at
rem
rem     http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem ---------------------------------------------------------------------------
rem Start script for the CATALINA Server
rem ---------------------------------------------------------------------------

setlocal

rem Guess CATALINA_HOME if not defined
set JAVA=H:\Program Files\java\jdk1.8
set "CURRENT_DIR=%cd%"

如上所示,然后保存关闭,右键以管理员身份启动该bat文件即可

然后在浏览中输入 localhost:8080/hello.html

写在后面的话,第一次写博客,有不好的地方请指出.thx

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值