-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- jawi#125: add 'jna.nosys=true' as system property will prevent JNA from using any system-installed JNA libraries; - jawi#140: add more advanced search for Java binaries on Windows (should work on Windows8 as well).
- Loading branch information
Jan Willem Janssen
committed
Jan 20, 2013
1 parent
c844c25
commit ddea7f6
Showing
2 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
@echo off | ||
|
||
rem Check whether the "magic" Java binary is available... | ||
java -version > NUL 2> NUL | ||
:findJavaSimple | ||
rem Simple check to see whether the "magic" Java binary is available on our path; | ||
rem based on <http://stackoverflow.com/questions/4681090/how-to-find-where-is-jdk-installed-on-my-windows-machine> | ||
for %i in (java.exe) do set JavaPath=%~$PATH:i | ||
%JavaPath% -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\javaw.exe" | ||
%JavaPath% -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. | ||
prompt | ||
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=%BASEDIR%\plugins | ||
set CLASSPATH=.;%BASEDIR%\bin\* | ||
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 | ||
|
||
rem For now, use the "console enabled" java for Windows... | ||
java %MEMSETTINGS% -Dnl.lxtreme.ols.bundle.dir="%PLUGINDIR%" -DPlastic.defaultTheme=SkyBluer -cp "%CLASSPATH%" nl.lxtreme.ols.runner.Runner | ||
goto end | ||
|
||
:noJVM | ||
echo It appears that Java is not installed on this computer. You | ||
echo should download and install the latest JDK. | ||
prompt | ||
exit 1 | ||
java %MEMSETTINGS% %SYSPROPS% -cp "%CLASSPATH%" nl.lxtreme.ols.runner.Runner | ||
|
||
:end | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters