You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tdk-dev@turbine.apache.org by jv...@apache.org on 2001/05/23 19:11:34 UTC
cvs commit: jakarta-turbine-tdk/src/bin catalina-oi.bat
jvanzyl 01/05/23 10:11:33
Added: src/bin catalina-oi.bat
Log:
- adding bat file so that optimize can be run with windows.
Revision Changes Path
1.1 jakarta-turbine-tdk/src/bin/catalina-oi.bat
Index: catalina-oi.bat
===================================================================
rem @echo off
rem This script allows to start Tomcat Jakarta for profiling with OptimizeIt.
rem It should be completed before use.
rem See the tutorial 'Profiling with Tomcat Jakarta' for more information.
rem This is the path to the Java home directory (e.g.: c:\jdk1.3)
set JAVAHOME=C:\java\j2sdk
rem This is the path to the Jakarta Tomcat directory (e.g.: c:\jakarta-tomcat)
set CATALINA_HOME=d:\bp\tdk
rem This is the path to OptimizeIt directory (e.g.: c:\OptimizeItDemo\OptimizeIt40D)
set OPTITDIR=C:\java\optimizeitdemo\OptimizeIt40D
rem Increase the GCOP value if you get some "GCOP buffer too small" errors
rem (size is in Mb)
set GCOPSIZE=1
rem Port number used by OptimizeIt (1470 is default)
set PORT=1470
rem Uncomment this line if you want to disable memory profiler
rem set OPTIONS="-dmp"
rem Uncomment this line if you use OptimizeIt's API
rem Warning! Selecting this option will disable OptimizeIt's memory and CPU profiler
rem Don't use that option unless you call OptimizeIt's API from your code
rem set OPTIONS="-enableAPI %OPTIONS%"
rem Add extra classpath after this statement
set JAVACLASSPATH=
rem Add extra java parameters here
set EXTRAJAVAPARM=
rem Choose here the OptimizeIt library you want to use (11,12 or jni).
rem Note: you should not have to set this field unless your JDK is not correctly recognized
set AUDITLIB=
rem You should not modify anything below this line
rem --------------------------------------------------------------------------------
set JAVA=%JAVAHOME%\bin\java.exe
if exist %JAVA% goto processOptItDir
set JAVA=%JAVAHOME%\bin\jre.exe
set JAVACLASSPATH=%JAVACLASSPATH%;%JAVAHOME%\lib\rt.jar
if exist %JAVA% goto processOptItDir
echo Cannot find any java.exe or jre.exe under the directory %JAVAHOME%.
echo Please make sure to specify a correct JAVAHOME in the script tomcatWithOptimizeIt.bat
pause
goto finish
:processOptItDir
if exist %OPTITDIR%\lib\optit.jar goto processCATALINA_HOME
echo Cannot find the OptimizeIt library optit.jar under the directory %OPTITDIR%.
echo Please make sure to specify a correct OPTITDIR in the script tomcatWithOptimizeIt.bat
pause
goto finish
:processCATALINA_HOME
if exist %CATALINA_HOME% goto processGCOP
echo The Tomcat directory specified %CATALINA_HOME% does not exist.
echo Please make sure to specify a correct CATALINA_HOME in the script tomcatWithOptimizeIt.bat
pause
goto finish
:processGCOP
if not "%GCOPSIZE%"=="" set JAVAPARAMETERS=-DGCOPSIZE=%GCOPSIZE%
if "%AUDITLIB%"=="" goto testVM
if "%AUDITLIB%"=="11" goto Audit11
if "%AUDITLIB%"=="12" goto Audit12
if "%AUDITLIB%"=="jni" goto AuditJNI
:testVM
SET PATH=%OPTITDIR%;%PATH%
%JAVA% -classpath "%CLASSPATH%;%OPTITDIR%\lib\optit.jar" intuitive.optit.fileop.JavaTester %JAVA% 1> nul 2>&1
if "%ERRORLEVEL%"=="-1" goto vmFailed
if "%ERRORLEVEL%"=="1" goto Audit11
if "%ERRORLEVEL%"=="2" goto Audit12
if "%ERRORLEVEL%"=="3" goto AuditJNI
echo Unrecognized virtual machine. Using AuditJNI.
goto AuditJNI
:vmFailed
echo The virtual machine could not be executed correctly. Please make sure that the executable %JAVA% can be run.
goto finish
:AuditJNI
set JAVAPARAMETERS=-Xrunoii -DAUDIT=jni %JAVAPARAMETERS%
goto processClassic
:Audit12
set JAVAPARAMETERS=-Xnoclassgc -Xrunoii -Djava.compiler=NONE -DAUDIT=12 %JAVAPARAMETERS%
:processClassic
%JAVA% -classic -version 1> nul 2>&1
if not "%ERRORLEVEL%"=="0" goto noClassic
set JAVAPARAMETERS=-classic %JAVAPARAMETERS%
goto classicDone
:noClassic
echo -classic not supported by this vm
:classicDone
set JAVACLASSPATH=%JAVAHOME%\lib\tools.jar;%JAVACLASSPATH%
goto processClassPath
:Audit11
set JAVAPARAMETERS=-ms64m -mx64m -noclassgc -Djava.compiler=NONE -DOPTITDIR=%OPTITDIR% -DAUDIT=11 %JAVAPARAMETERS%
set JAVACLASSPATH=%JAVAHOME%\lib\classes.zip;%JAVACLASSPATH%
:processClassPath
SET PATH=%OPTITDIR%\lib;.\bin;%PATH%
rem JAVACLASSPATH=%OPTITDIR%\lib\optit.jar;%CATALINA_HOME%\classes;%CATALINA_HOME%\lib\webserver.jar;%CATALINA_HOME%\lib\jasper.jar;%CATALINA_HOME%\lib\xml.jar;%CATALINA_HOME%\lib\servlet.jar;%CATALINA_HOME%\lib\jaxp.jar;%CATALINA_HOME%\lib\parser.jar;%CATALINA_HOME%\bin\bootstrap.jar;%JAVACLASSPATH%
set JAVACLASSPATH=%OPTITDIR%\lib\optit.jar;%CATALINA_HOME%\bin\bootstrap.jar;%JAVACLASSPATH%
SET JAVAPARAMETERS=%JAVAPARAMETERS% %EXTRAJAVAPARAM%
echo "%JAVA% %JAVAPARAMETERS% -classpath %JAVACLASSPATH% -Dcatalina.home=%CATALINA_HOME% intuitive.audit.Audit -port %PORT% %OPTIONS% org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9"
rem %JAVA% %JAVAPARAMETERS% -classpath "%JAVACLASSPATH%" -Dcatalina.home=%CATALINA_HOME% intuitive.audit.Audit -port %PORT% %OPTIONS% org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9
%JAVA% %JAVAPARAMETERS% -classpath "%JAVACLASSPATH%" -Dcatalina.home=%CATALINA_HOME% intuitive.audit.Audit -port %PORT% %OPTIONS% org.apache.catalina.startup.Bootstrap start %3 %4 %5 %6 %7 %8 %9
if errorlevel 1 pause
:finish
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-tdk-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-tdk-dev-help@jakarta.apache.org