Skip to content

Instantly share code, notes, and snippets.

@sybeck2k
Created June 5, 2014 19:06
Show Gist options
  • Save sybeck2k/57a700b840bc0c63552f to your computer and use it in GitHub Desktop.
Save sybeck2k/57a700b840bc0c63552f to your computer and use it in GitHub Desktop.
Ols 0.9.7 working run.bat!
@echo on
:findJavaSimple
rem Simple check to see whether the "magic" Java binary is available on our path;
java -version > NUL 2> NUL
if errorlevel 1 goto findJavaAdvanced
goto setup
:findJavaAdvanced
rem See <https://github.com/jawi/ols/issues/140>
for /F "tokens=2*" %%A in ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{5852F5E0-8BF4-11D4-A245-0080C6F74284}\1.0\HELPDIR" /ve') do set JavaPath="%%B"
set path=%path%;%JavaPath%
java -version > NUL 2> NUL
if errorlevel 1 goto noJVM
goto setup
:noJVM
echo It appears that Java is not installed on this computer. You
echo should download and install the latest JRE.
pause
exit 1
:setup
rem determine the location this script is run in...
set BASEDIR=%~dp0
rem all paths are used relatively from the base dir...
set PLUGINDIR=plugins
set CLASSPATH=bin\runner-1.1.1.jar;bin\looks-2.2.2.jar;bin\org.apache.felix.configadmin-1.4.0.jar;bin/org.apache.felix.fileinstall-3.2.4.jar;bin/org.apache.felix.main-4.0.2.jar
rem give the client roughly 1gigabyte of memory
set MEMSETTINGS=-Xmx1024m
rem <https://github.com/jawi/ols/issues/125>
set SYSPROPS=-Djna.nosys=true -Dnl.lxtreme.ols.bundle.dir="%PLUGINDIR%" -DPlastic.defaultTheme=SkyBluer -classpath "%CLASSPATH%"
rem For now, use the "console enabled" java for Windows...
"C:\Program Files\Java\jre6\bin\java" %MEMSETTINGS% %SYSPROPS% nl.lxtreme.ols.runner.Runner
:end
pause
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment