首页 > 学院 > 操作系统 > 正文

jdk1.7 tomcat-7安装

2024-06-28 13:25:05
字体:
来源:转载
供稿:网友
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
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表