zoukankan      html  css  js  c++  java
  • Tomcat无法正常启动,解决办法

    问题:tomcat 无法启动,报Error:参数初始错误

    原因: java jdk 和 Tomcat 不能放置在有相同Folder的文件夹下

    之前安装路径:

    D:Program FilesJava
     D:java

    解决办法:

      java jdk 安装路径:D:Program FilesJava

      tomcate 安装路径:D:javaw

      tomcate 不需要配置环境变量,解决办法

    编辑:D:javavapache-tomcat-7.0.34insetclasspath.bat

    增加如下代码:

    set JAVA_HOME=D:Program FilesJavajdk1.7.0_51
    set JRE_HOME=D:Program FilesJavajre7

    最终效果如下:

    @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 Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings
    rem are valid and consistent with the selected start-up options and set up the
    rem endorsed directory.
    rem
    rem $Id: setclasspath.bat 1202062 2011-11-15 06:50:02Z mturk $
    rem ---------------------------------------------------------------------------
    set JAVA_HOME=D:Program FilesJavajdk1.7.0_51
    set JRE_HOME=D:Program FilesJavajre7
    
    
    rem Make sure prerequisite environment variables are set
    
    rem In debug mode we need a real JDK (JAVA_HOME)
    if ""%1"" == ""debug"" goto needJavaHome
    
    rem Otherwise either JRE or JDK are fine
    if not "%JRE_HOME%" == "" goto gotJreHome
    if not "%JAVA_HOME%" == "" goto gotJavaHome
    echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
    echo At least one of these environment variable is needed to run this program
    goto exit
    
    :needJavaHome
    rem Check if we have a usable JDK
    if "%JAVA_HOME%" == "" goto noJavaHome
    if not exist "%JAVA_HOME%injava.exe" goto noJavaHome
    if not exist "%JAVA_HOME%injavaw.exe" goto noJavaHome
    if not exist "%JAVA_HOME%injdb.exe" goto noJavaHome
    if not exist "%JAVA_HOME%injavac.exe" goto noJavaHome
    set "JRE_HOME=%JAVA_HOME%"
    goto okJava
    
    :noJavaHome
    echo The JAVA_HOME environment variable is not defined correctly.
    echo It is needed to run this program in debug mode.
    echo NB: JAVA_HOME should point to a JDK not a JRE.
    goto exit
    
    :gotJavaHome
    rem No JRE given, use JAVA_HOME as JRE_HOME
    set "JRE_HOME=%JAVA_HOME%"
    
  • 相关阅读:
    select函数
    ascy_finder|base|cookie 代码测试
    正则表达式之道
    教务系统破解
    jquery API
    test
    如何获取和发送Http请求和相应
    header中ContentDisposition的作用
    Performance Testing 系列
    LINQ
  • 原文地址:https://www.cnblogs.com/kittyguo/p/4818332.html
Copyright © 2011-2022 走看看