Dear Giuseppe,
Thanks for your good and quick reply,
this is the LS.bat:
@echo off
if "%OS%" == "Windows_NT" setlocal
rem ================================================== ==================
rem === CHECK THIS OUT
rem ================================================== ==================
rem JAVA_HOME must point to your Java Development Kit installation
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05\jre
rem ================================================== =====================
rem === CHECK THIS OUT
rem ================================================== =====================
rem JAVA_OPTS should contain any Java Virtual Machine options. Here are some tips:
rem 1) Always use the "-server" option.
rem 2) Give more RAM to the server process, especially with heavy traffic, by specifying a min and max "heap"
rem E.g.: If you have 4 GB and the box is dedicated to Lightstreamer, you might set 1 GB min heap and 3 GB max
rem heap with these options: "-Xms1G -Xmx3G"
rem 3) Choose a better "garbage collector" if you want to reduce latency. An option that often gives good results is:
rem "-XX:+UseConcMarkSweepGC". Only if you are using a very recent version of Java 7, you might prefer to try:
rem "-XX:+UseG1GC". Many other tuning options are available (please see Oracle docs).
set JAVA_OPTS=-server
rem --------------------------------------------------------------------
rem LS_HOME takes the current directory of LS.bat and goes up two dirs
set LS_HOME=%~dp0..\..\
echo Lightstreamer Server directory:
echo LS_HOME = %LS_HOME%
echo.
if ""%1"" == ""run"" goto doStart
if ""%1"" == ""silent"" goto doStart
if ""%1"" == ""background"" goto doStart
if ""%1"" == ""stop"" goto doStop
if ""%1"" == ""restart"" goto doStop
echo Usage: LS.bat ( command )
echo commands:
echo run Start Lightstreamer Server in the current window
echo background Start Lightstreamer Server in a separate window
echo stop Stop Lightstreamer Server
echo restart Stop Lightstreamer Server and start a new instance in a separate window
goto end
rem Main class
:doStart
echo Starting Lightstreamer Server...
echo Please check logs for detailed information.
set class=com.lightstreamer.LS
goto doLaunch
:doStop
echo Stopping Lightstreamer Server...
set class=com.lightstreamer.LS_Stop
goto doLaunch
:doLaunch
rem Configuration file
set args="%LS_HOME%\conf\lightstreamer_conf.xml"
rem Classpath
set cpath="%LS_HOME%\lib\lightstreamer.jar";"%LS_HOME% \lib\ls-adapter-interface.jar";"%LS_HOME%\lib\ls-monitor.jar";"%LS_HOME%\lib\*"
rem Launch command
set command="%JAVA_HOME%\bin\java.exe" %JAVA_OPTS% -cp %cpath% %class% %args%
set minimal_command="%JAVA_HOME%\bin\java.exe" -cp %cpath% %class% %args%
if ""%1"" == ""run"" goto doForeground
if ""%1"" == ""silent"" goto doSilent
if ""%1"" == ""background"" goto doBackground
if ""%1"" == ""stop"" goto doStop
if ""%1"" == ""restart"" goto doSubcall
:doSubcall
rem call command and wait
call %command%
%0 background
goto end
:doForeground
rem leave control to command
%command%
goto end
:doSilent
rem rerun after output redirection (for run as a service)
set output="%LS_HOME%\logs\LS.out"
%0 run 1>> %output% 2>&1
goto end
:doStop
rem leave control to command
%minimal_command%
goto end
:doBackground
rem call command in a separate window and leave
if not "%OS%" == "Windows_NT" goto noTitle
start "Lightstreamer Server" %command%
goto end
:noTitle
start %command%
goto end
Bookmarks