jdk1.7 tomcat-7安装,jdk1.7tomcat-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

tar -zxvf jdk1.7.0_60.tar.gz 
mv jdk1.7.0_60 /usr
vi /etc/profile

在prifile文件结尾插入下一段

export JAVA_HOME=/usr/jdk1.7.0_60
export JAVA_BIN=/usr/jdk1.7.0_60/bin 
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

保存文档,然后让配置生效

source /etc/profile

安装tomcat

tar -zxvf apache-tomcat-7.0.54.tar.gz
cp -r /tmp/apache-tomcat-7.0.54 /data
cd /data
mv apache-tomcat-7.0.54/ tomcat
cd /data/tomcat/bin
./startup.sh 
用浏览器打开如下的网页  http://localhost:8080/;
如果你见到Tomcat的网页(index.jsp),证明Tomcat安装成功,并已经启动.
    jdk环境错误,$JAVA_HOME这个变量没有定义时,解决情况如下
cd /data/tomcat/bin
vi 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 set
export JAVA_HOME=/usr/jdk1.7.0_60
export JRE_HOME=/usr/jdk1.7.0_60/jre/
 
 
保存文本,重启tomcat

tomcat安装目录E:\apache-tomcat-7032 ,jdk17安装目录E:\Java 那tomcat怎配置 ?

你好,首先确认你本机上已经安装了JDK,并且配置成功,这才是前提。
配置jdk的环境变量:
JAVA_HOME=E:\Java
classpath=.;E:\Java\一直到lib下
path=E:\Java\一直到bin下
就这样就OK了。
 

tomcat jdk版本低 我机器有安装的jdk17 怎替换tomcat的jdk ?

tomcat的启动rub.bat修改java_home路径啊,到里面
set /p java_home,写死了,然后就可以了,tomcat8才支持jdk7呢,其他都是别的。
太简单了
 

相关内容