MENU

JDK环境变量配置

• July 6, 2020 • Read: 249 • 教程

1.安装jdk程序

安装路径为:C:\Program Files\Java\jdk1.7.0_25

2.配置Java

右键--》计算机--》属性--》高级系统设置--》高级选显卡选择 环境变量---》系统变量,新建变量JAVA_HOME,它的值为C:\Program Files\Java\jdk1.7.0_25;

系统变量找到path,在path设置值最前面面输入:%JAVA_HOME%\bin;

3.在命令提示符窗口,验证java是否配置完成。

java -version

4.解压apache-tomcat-6.0.48-windows-x86,然后在apache-tomcat-6.0.48-windows-x86\apache-tomcat-6.0.48\bin,打开startup,

5.验证tomcat是否配置成功,打开浏览器,在地址栏输入:http://localhost:8080

配置虚拟目录

1.改默认端口号为80端口

在tomcat安装家目录,找到conf文件夹,打开server.xml,找到Connector port="8080",将8080端口改为80;
2.找到<Host name="localhost"
添加<Context docBase="你的web应用所在目录" path="网址路径"></Context>

3.找到你的web应用文件夹,新建一个WEB-INF文件夹,在WEB-INF文件夹创建一个web.xml文件,输入以下内容

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">


    <welcome-file-list>
        <welcome-file>1.html</welcome-file>
    </welcome-file-list>

</web-app>

<welcome-file-list>
        <welcome-file>1.html</welcome-file>
    </welcome-file-list>

修改<welcome-file>改为你的首页html</welcome-file>

您的大名:
万水千山总是情,给个打赏行不行。 打赏
- - - The END - - -
  • 文章标题:JDK环境变量配置
  • 文章链接:https://gxusb.com/118.html
  • 版权所有:本文版权归Get-林林小窝 所有,转载请注明出处!除特殊注明外(如有侵权,请联系 gxggxl@qq.com ),本站原创内容均采用 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 进行许可
  • 广而告之

    Last Modified: July 17, 2020
    Archives QR Code
    QR Code for this page
    Tipping QR Code