zoukankan      html  css  js  c++  java
  • JavaWeb-tomcat安装(Unsupported major.minor version 51.0/startup.bat闪退)

    JavaWeb-tomcat安装(Unsupported major.minor version 51.0)

     

    一 启动startup.bat 出错i

    今天安装tomcat出错,折腾了一下午,收获了许多,特此分享一下,同时也分享一下自己总结的方法

     

    二 寻错方法

    和我一样,大多数出现闪退的时候,百度一下大多数结果都是环境错误,我的环境虽然没有错,但也检查了很久,心很累

    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.

    if "%OS%" == "Windows_NT" setlocal rem --------------------------------------------------------------------------- rem Start script for the CATALINA Server rem ---------------------------------------------------------------------------

    rem Guess CATALINA_HOME if not defined set "CURRENT_DIR=%cd%" if not "%CATALINA_HOME%" == "" goto gotHome set "CATALINA_HOME=%CURRENT_DIR%" if exist "%CATALINA_HOME%incatalina.bat" goto okHome cd .. set "CATALINA_HOME=%cd%" cd "%CURRENT_DIR%" :gotHome if exist "%CATALINA_HOME%incatalina.bat" goto okHome echo The CATALINA_HOME environment variable is not defined correctly echo This environment variable is needed to run this program goto end :okHome

    set "EXECUTABLE=%CATALINA_HOME%incatalina.bat"

    rem Check that target executable exists if exist "%EXECUTABLE%" goto okExec echo Cannot find "%EXECUTABLE%" echo This file is needed to run this program goto end :okExec

    rem Get remaining unshifted command line arguments and save them in the set CMD_LINE_ARGS= :setArgs if ""%1""=="""" goto doneSetArgs set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 shift goto setArgs :doneSetArgs

    call "%EXECUTABLE%" start %CMD_LINE_ARGS%   //将start改为run

    :end

    PAUSE    //末尾加上Pause

    可以直接看到自己的错误的信息,进而进行处理

    三 错误处理

    JAVA_HOME 错误:环境变量错误

    Unsupported major.minor version 51.0 错误:jdk版本和tomcat中的class文件版本不对应,解决方式jdk1.6对应tomcat6.xx,应该是一一对应

    大家如果还有问题可以留言交流,与君共学!

  • 相关阅读:
    高速排序(递归与分治的思想)
    silverlight wcf mvvm
    黑龙江绿色食品青年电商销售大赛开幕,绿色巨人最终发力做电商了
    ecnu 1244
    可穿戴KEY带来的身份认证的革命
    深入理解7816(3)-----关于T=0 【转】
    深入理解7816(1)---- 关于F/D和etu【转】
    深入理解7816(2)---关于ATR【转】
    [Android 编译(一)] Ubuntu 16.04 LTS 成功编译 Android 6.0 源码教程
    Ubuntu16.04下搭建开发环境及编译tiny4412 Android系统【转】
  • 原文地址:https://www.cnblogs.com/qiujun/p/6793072.html
Copyright © 2011-2022 走看看