jdk1.7 tomcat-7安装

王朝学院·作者佚名  2016-05-27
窄屏简体版  字體: 小  |  中  |  大  |  超大  

jdk1.7 tomcat-7安装由于软件下载地址经常有变动,所以不能直接wget,还是直接到网上点击下载

下载jdk

http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

选中Accept License Agreement,选择64位的jdk-7u65-linux-x64.tar.gz,如下图

下载tomcat,tomcat版本会更新,以下载版本号为准

http://tomcat.apache.org/download-70.cgi

把软件上传到/tmp中

安装jdk

cd /tmptar -zxvf jdk-7u60-linux-x64.gzmv jdk1.7.0_60 /usrvi /etc/PRofile

在prifile文件结尾插入下一段

export JAVA_HOME=/usr/jdk1.7.0_60export JAVA_BIN=/usr/jdk1.7.0_60/binexport PATH=$PATH:$JAVA_HOME/binexport CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarexport PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH保存文档,然后让配置生效

source /etc/profile

安装tomcat

tar -zxvf apache-tomcat-7.0.54.tar.gzcp -r /tmp/apache-tomcat-7.0.54 /datacd /datamv apache-tomcat-7.0.54/ tomcatcd /data/tomcat/bin./startup.sh

用浏览器打开如下的网页http://localhost:8080/;如果你见到Tomcat的网页(index.jsp),证明Tomcat安装成功,并已经启动.jdk环境错误,$JAVA_HOME这个变量没有定义时,解决情况如下cd /data/tomcat/binvi setclasspath.sh

在setclasspath.sh中插入红色部分

#!/bin/sh# 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.# -----------------------------------------------------------------------------# Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings# are valid and consistent with the selected start-up options and set up the# endorsed directory.# -----------------------------------------------------------------------------# Make sure prerequisite environment variables are setexport JAVA_HOME=/usr/jdk1.7.0_60export JRE_HOME=/usr/jdk1.7.0_60/jre/保存文本,重启tomcat

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航