:: Variables that you don't need to change unless you are debugging. 

set argC=0
for %%x in (%*) do Set /A argC+=1
echo argument count=%argC%
echo.

echo params: %*
echo.

set JAVAOPTS=-Xms128m -Xmx512m
echo JAVAOPTS=%JAVAOPTS%
echo.

:: Always set the Protocol to TLSv1.2
set JAVA_EXT_OPTS=-Dhttps.protocols=TLSv1.2
echo Setting TLS Protocol [%JAVA_EXT_OPTS%] to run
set CLASS=%PACKAGE%.%1 
echo Setting class [%CLASS%] to run
echo.


:: Dynamically set the classpath
echo Creating a classpath from the contents of your lib directory ...
set TEMP_CP=
FOR %%i IN ( %LIB_DIR%\*.*) DO call classpathAppend.bat %%i
set CLASSPATH=%TEMP_CP%
echo classpath: %CLASSPATH%
echo.


:: Run the test application with all arguments...
echo "========================================================"
echo %JAVA_HOME%\bin\java %JAVAOPTS% %JAVA_EXT_OPTS% %CLASS% %*
echo "========================================================"
:: Actual Execution of the Java Command (No debugging enabled).
"%JAVA_HOME%\bin\java" %JAVAOPTS% %JAVA_EXT_OPTS% %CLASS% %*

:: Uncomment this command to enable JAVA remote debugging and SSL debugging...
::"%JAVA_HOME%\bin\java" -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Djavax.net.debug=ssl,handshake -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=5050,server=y,suspend=n %JAVAOPTS% %JAVA_EXT_OPTS% %CLASS% %*

:: Uncomment this command to enable SSL debugging only...
::"%JAVA_HOME%\bin\java" -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Djavax.net.debug=ssl,handshake %JAVAOPTS% %JAVA_EXT_OPTS% %CLASS% %*


:: Uncomment this command to enable JAVA remote debugging only...
::"%JAVA_HOME%\bin\java" -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=5050,server=y,suspend=y %JAVAOPTS% %JAVA_EXT_OPTS% %CLASS% %*


:End

