@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  bowler-script-kernel startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..

@rem Add default JVM options here. You can also use JAVA_OPTS and BOWLER_SCRIPT_KERNEL_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\lib\BowlerScriptingKernel-0.36.0.jar;%APP_HOME%\lib\cmulex.jar;%APP_HOME%\lib\nrV4J-3.8.1.jar;%APP_HOME%\lib\cmudict04.jar;%APP_HOME%\lib\cmu_time_awb.jar;%APP_HOME%\lib\cmutimelex.jar;%APP_HOME%\lib\mbrola.jar;%APP_HOME%\lib\stack-alloc.jar;%APP_HOME%\lib\freetts-jsapi10.jar;%APP_HOME%\lib\rosjava-0.1.6.jar;%APP_HOME%\lib\jbullet-2.72.2.4-sources.jar;%APP_HOME%\lib\asm-all-3.1.jar;%APP_HOME%\lib\jsapi.jar;%APP_HOME%\lib\jbullet-2.72.2.4.jar;%APP_HOME%\lib\jl1.0.jar;%APP_HOME%\lib\freetts.jar;%APP_HOME%\lib\cmu_us_kal.jar;%APP_HOME%\lib\en_us.jar;%APP_HOME%\lib\nrsdk-3.27.0-jar-with-dependencies.jar;%APP_HOME%\lib\nr-jinput.jar;%APP_HOME%\lib\bluecove-gpl-2.1.1.jar;%APP_HOME%\lib\motej.0.9.jar;%APP_HOME%\lib\bluecove-2.1.1.jar;%APP_HOME%\lib\jama-1.0.2.jar;%APP_HOME%\lib\richtextfx-0.6.jar;%APP_HOME%\lib\flowless-0.4.jar;%APP_HOME%\lib\undofx-2.1.0.jar;%APP_HOME%\lib\reactfx-2.0-M5.jar;%APP_HOME%\lib\groovy-2.3.7.jar;%APP_HOME%\lib\ivy-2.2.0.jar;%APP_HOME%\lib\github-api-1.66.jar;%APP_HOME%\lib\stapler-1.237.jar;%APP_HOME%\lib\json-lib-2.4-jenkins-2.jar;%APP_HOME%\lib\ezmorph-1.0.6.jar;%APP_HOME%\lib\commons-lang-2.6.jar;%APP_HOME%\lib\org.eclipse.jgit-4.0.1.201506240215-r.jar;%APP_HOME%\lib\httpclient-4.5.1.jar;%APP_HOME%\lib\commons-codec-1.9.jar;%APP_HOME%\lib\okhttp-urlconnection-2.0.0.jar;%APP_HOME%\lib\wordnet-random-name-1.2.jar;%APP_HOME%\lib\mockito-all-1.9.5.jar;%APP_HOME%\lib\bridge-method-injector-1.14.jar;%APP_HOME%\lib\miglayout-swing-4.2.jar;%APP_HOME%\lib\JavaCad-0.19.0.jar;%APP_HOME%\lib\batik-all.jar;%APP_HOME%\lib\miethxml-ui.jar;%APP_HOME%\lib\kabeja-0.4.jar;%APP_HOME%\lib\xml-apis.jar;%APP_HOME%\lib\pdf-transcoder.jar;%APP_HOME%\lib\kabeja-svg-0.4.jar;%APP_HOME%\lib\xml-apis-ext.jar;%APP_HOME%\lib\kabeja-xslt.jar;%APP_HOME%\lib\js.jar;%APP_HOME%\lib\miethxml-toolkit.jar;%APP_HOME%\lib\commons-io-2.4.jar;%APP_HOME%\lib\jython-2.5.3.jar;%APP_HOME%\lib\jython-standalone-2.5.2.jar;%APP_HOME%\lib\clojure-1.8.0.jar;%APP_HOME%\lib\jetty-webapp-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-servlet-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-security-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-server-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-servlets-9.0.2.v20130417.jar;%APP_HOME%\lib\javax.servlet-api-3.1.0.jar;%APP_HOME%\lib\vecmath-1.3.1.jar;%APP_HOME%\lib\slf4j-simple-1.6.1.jar;%APP_HOME%\lib\jxl-2.4.2.jar;%APP_HOME%\lib\de.huxhorn.sulky.3rdparty.jlayer-1.0.jar;%APP_HOME%\lib\gson-2.5.jar;%APP_HOME%\lib\jsoup-1.8.3.jar;%APP_HOME%\lib\jmf-2.1.1e.jar;%APP_HOME%\lib\firmata4j-2.3.4.1.jar;%APP_HOME%\lib\wellbehavedfx-0.1.1.jar;%APP_HOME%\lib\easybind-1.0.4-SNAPSHOT.jar;%APP_HOME%\lib\javax.annotation-api-1.2.jar;%APP_HOME%\lib\commons-discovery-0.4.jar;%APP_HOME%\lib\commons-beanutils-1.8.0.jar;%APP_HOME%\lib\localizer-1.7.jar;%APP_HOME%\lib\tiger-types-1.3.jar;%APP_HOME%\lib\guava-14.0.jar;%APP_HOME%\lib\asm5-5.0.1.jar;%APP_HOME%\lib\commons-fileupload-1.2.1.jar;%APP_HOME%\lib\jsr305-2.0.1.jar;%APP_HOME%\lib\jzlib-1.1.3.jar;%APP_HOME%\lib\jsch-0.1.51.jar;%APP_HOME%\lib\JavaEWAH-0.7.9.jar;%APP_HOME%\lib\slf4j-api-1.7.7.jar;%APP_HOME%\lib\okhttp-2.0.0.jar;%APP_HOME%\lib\bridge-method-annotation-1.14.jar;%APP_HOME%\lib\asm-debug-all-4.2.jar;%APP_HOME%\lib\maven-plugin-api-2.0.1.jar;%APP_HOME%\lib\jackson-databind-2.2.3.jar;%APP_HOME%\lib\miglayout-core-4.2.jar;%APP_HOME%\lib\javax.servlet-3.0.0.v201112011016.jar;%APP_HOME%\lib\jetty-http-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-io-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-continuation-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-xml-9.0.2.v20130417.jar;%APP_HOME%\lib\jetty-util-9.0.2.v20130417.jar;%APP_HOME%\lib\json-simple-1.1.jar;%APP_HOME%\lib\vvecmath-0.3.2.jar;%APP_HOME%\lib\batik-svggen-1.7.jar;%APP_HOME%\lib\smack-3.2.1.jar;%APP_HOME%\lib\smackx-3.2.1.jar;%APP_HOME%\lib\usb4java-javax-1.2.0.jar;%APP_HOME%\lib\usb4java-1.2.0.jar;%APP_HOME%\lib\nrjavaserial-3.12.1.jar;%APP_HOME%\lib\commons-lang3-3.2.1.jar;%APP_HOME%\lib\commons-math3-3.6.1.jar;%APP_HOME%\lib\httpcore-4.4.3.jar;%APP_HOME%\lib\commons-logging-1.2.jar;%APP_HOME%\lib\jssc-2.8.0.jar;%APP_HOME%\lib\commons-collections-3.2.1.jar;%APP_HOME%\lib\okio-1.0.0.jar;%APP_HOME%\lib\annotation-indexer-1.4.jar;%APP_HOME%\lib\jackson-annotations-2.2.3.jar;%APP_HOME%\lib\jackson-core-2.2.3.jar;%APP_HOME%\lib\batik-awt-util-1.7.jar;%APP_HOME%\lib\batik-util-1.7.jar;%APP_HOME%\lib\xml-apis-1.3.04.jar;%APP_HOME%\lib\libusb4java-1.2.0-linux-x86.jar;%APP_HOME%\lib\libusb4java-1.2.0-linux-x86_64.jar;%APP_HOME%\lib\libusb4java-1.2.0-linux-arm.jar;%APP_HOME%\lib\libusb4java-1.2.0-windows-x86.jar;%APP_HOME%\lib\libusb4java-1.2.0-windows-x86_64.jar;%APP_HOME%\lib\libusb4java-1.2.0-osx-x86.jar;%APP_HOME%\lib\libusb4java-1.2.0-osx-x86_64.jar;%APP_HOME%\lib\usb-api-1.0.2.jar;%APP_HOME%\lib\commons-net-3.3.jar

@rem Execute bowler-script-kernel
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %BOWLER_SCRIPT_KERNEL_OPTS%  -classpath "%CLASSPATH%" com.neuronrobotics.bowlerstudio.BowlerKernel %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable BOWLER_SCRIPT_KERNEL_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%BOWLER_SCRIPT_KERNEL_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
