@echo off

SET MAIN_CLASS=org.jfox.framework.Startup

if not "%JAVA_HOME%" == "" goto JFOX_CLASSPATH
echo JAVA_HOME is not set.
echo please set JAVA_HOME enironment viriable first.
goto EXIT

:JFOX_CLASSPATH
SET JFOX_CLASSPATH=../conf;../framework/classes;../framework/lib/log4j-1.2.8.jar
goto JFOX_MEMORY_OPTS

:JFOX_MEMORY_OPTS
SET JFOX_MEMORY_OPTS=-Xms128m -Xmx512m
goto JFOX_GC_OPTS

:JFOX_GC_OPTS
SET JFOX_GC_OPTS=
goto RUN

:RUN
echo =======================================
echo   JFox Application Server Version 2
echo   JAVA_HOME: %JAVA_HOME%
echo   Memory Options: %JFOX_MEMORY_OPTS%
echo   GC Options: %JFOX_GC_OPTS%
echo =======================================

%JAVA_HOME%\bin\java -server %JFOX_MEMORY_OPTS% -classpath %JFOX_CLASSPATH% %MAIN_CLASS%

:EXIT
