tomcat启动寻找JAVA环境
来源:互联网 发布:php类与对象person 编辑:程序博客网 时间:2024/05/19 03:17
step:startup.bat
setlocalrem Guess CATALINA_HOME if not definedset "CURRENT_DIR=%cd%"if not "%CATALINA_HOME%" == "" goto gotHomeset "CATALINA_HOME=%CURRENT_DIR%"if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomecd ..set "CATALINA_HOME=%cd%"cd "%CURRENT_DIR%":gotHomeif exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomeecho The CATALINA_HOME environment variable is not defined correctlyecho This environment variable is needed to run this programgoto end:okHomeset "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat"rem Check that target executable existsif exist "%EXECUTABLE%" goto okExececho Cannot find "%EXECUTABLE%"echo This file is needed to run this programgoto end:okExecrem Get remaining unshifted command line arguments and save them in theset CMD_LINE_ARGS=:setArgsif ""%1""=="""" goto doneSetArgsset CMD_LINE_ARGS=%CMD_LINE_ARGS% %1shiftgoto setArgs:doneSetArgscall "%EXECUTABLE%" start %CMD_LINE_ARGS%:end找到catalina的配置信息,紧接着我们可以去catalina.bat看一下
step2:catalina.bat
setlocalrem Suppress Terminate batch job on CTRL+Cif not ""%1"" == ""run"" goto mainEntryif "%TEMP%" == "" goto mainEntryif exist "%TEMP%\%~nx0.run" goto mainEntryecho Y>"%TEMP%\%~nx0.run"if not exist "%TEMP%\%~nx0.run" goto mainEntryecho Y>"%TEMP%\%~nx0.Y"call "%~f0" %* <"%TEMP%\%~nx0.Y"rem Use provided errorlevelset RETVAL=%ERRORLEVEL%del /Q "%TEMP%\%~nx0.Y" >NUL 2>&1exit /B %RETVAL%:mainEntrydel /Q "%TEMP%\%~nx0.run" >NUL 2>&1rem Guess CATALINA_HOME if not definedset "CURRENT_DIR=%cd%"if not "%CATALINA_HOME%" == "" goto gotHomeset "CATALINA_HOME=%CURRENT_DIR%"if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomecd ..set "CATALINA_HOME=%cd%"cd "%CURRENT_DIR%":gotHomeif exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomeecho The CATALINA_HOME environment variable is not defined correctlyecho This environment variable is needed to run this programgoto end:okHomerem Copy CATALINA_BASE from CATALINA_HOME if not definedif not "%CATALINA_BASE%" == "" goto gotBaseset "CATALINA_BASE=%CATALINA_HOME%":gotBaserem Ensure that neither CATALINA_HOME nor CATALINA_BASE contains a semi-colonrem as this is used as the separator in the classpath and Java provides norem mechanism for escaping if the same character appears in the path. Check thisrem by replacing all occurrences of ';' with '' and checking that neitherrem CATALINA_HOME nor CATALINA_BASE have changedif "%CATALINA_HOME%" == "%CATALINA_HOME:;=%" goto homeNoSemicolonecho Using CATALINA_HOME: "%CATALINA_HOME%"echo Unable to start as CATALINA_HOME contains a semicolon (;) charactergoto end:homeNoSemicolonif "%CATALINA_BASE%" == "%CATALINA_BASE:;=%" goto baseNoSemicolonecho Using CATALINA_BASE: "%CATALINA_BASE%"echo Unable to start as CATALINA_BASE contains a semicolon (;) charactergoto end:baseNoSemicolonrem Ensure that any user defined CLASSPATH variables are not used on startup,rem but allow them to be specified in setenv.bat, in rare case when it is needed.set CLASSPATH=rem Get standard environment variablesif not exist "%CATALINA_BASE%\bin\setenv.bat" goto checkSetenvHomecall "%CATALINA_BASE%\bin\setenv.bat"goto setenvDone:checkSetenvHomeif exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat":setenvDonerem Get standard Java environment variablesif exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspathecho Cannot find "%CATALINA_HOME%\bin\setclasspath.bat"echo This file is needed to run this programgoto end:okSetclasspathcall "%CATALINA_HOME%\bin\setclasspath.bat" %1if errorlevel 1 goto endrem Add on extra jar file to CLASSPATHrem Note that there are no quotes as we do not want to introduce randomrem quotes into the CLASSPATHif "%CLASSPATH%" == "" goto emptyClasspathset "CLASSPATH=%CLASSPATH%;":emptyClasspathset "CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar"if not "%CATALINA_TMPDIR%" == "" goto gotTmpdirset "CATALINA_TMPDIR=%CATALINA_BASE%\temp":gotTmpdir
cataina的系统相关配置完成之后,在这个过程中需要调用名为setclasspath.bat的信息
step3:setclasspath.bat
set "JAVA_HOME=D:\Program Files\Java\jdk1.8.0_101"rem Make sure prerequisite environment variables are setrem In debug mode we need a real JDK (JAVA_HOME)if ""%1"" == ""debug"" goto needJavaHomerem Otherwise either JRE or JDK are fineif not "%JRE_HOME%" == "" goto gotJreHomeif not "%JAVA_HOME%" == "" goto gotJavaHomeecho Neither the JAVA_HOME nor the JRE_HOME environment variable is definedecho At least one of these environment variable is needed to run this programgoto exit:needJavaHomerem Check if we have a usable JDKif "%JAVA_HOME%" == "" goto noJavaHomeif not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHomeif not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHomeif not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHomeif not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHomeset "JRE_HOME=%JAVA_HOME%"goto okJava:noJavaHomeecho 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会在这里寻找JAVA_HOME环境变量设置的路径,在这里我们可以设置
0 0
- tomcat启动寻找JAVA环境
- JAVA环境配置及tomcat的启动
- Mac终端搭建java web环境-安装启动tomcat
- Linux (CentOS 7.3) 下安装JAVA环境和Tomcat环境启动Tomcat服务器
- tomcat部署启动环境配置
- 启动Tomcat环境报错
- java 启动Tomcat
- Java Tomcat 启动异常
- java程序控制tomcat启动
- java程序控制tomcat启动
- tomcat用java启动
- java环境和Tomcat环境
- java tomcat 环境配置
- tomcat java环境配置
- java tomcat 环境配置
- tomcat启动的时候为什么会有一个java.exe进程and如何在tomcat配置java环境
- 燃烧的远征java(二)-开发环境:eclipse 中tomcat无法启动
- linux环境下启动tomcat报错java.lang.UnsupportedClassVersionError: Bad version number in .class file
- Python操控MySql
- 区块链学堂(第二课):以太坊基本概念+Geth 安装
- Thirft简介与用法
- ALSA --- amixer控制声卡驱动实现Line-in功能
- 关于AppSplash启动优化
- tomcat启动寻找JAVA环境
- 【随笔】关于坚持
- elasticsearch 查询(match和term)
- python 画图--饼图
- Stuts2国际化
- 支持POST方式的webbench
- Vue.js学习系列(二十五)-- 循环语句(一)
- 排序-插入排序
- MySQL 最最简单命令---- 慢慢收集