forked from gridgain/gridgain-old
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathggvisorcmd.bat
More file actions
153 lines (123 loc) · 4.57 KB
/
ggvisorcmd.bat
File metadata and controls
153 lines (123 loc) · 4.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
::
:: Copyright (C) GridGain Systems. All Rights Reserved.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
:: _________ _____ __________________ _____
:: __ ____/___________(_)______ /__ ____/______ ____(_)_______
:: _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \
:: / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / /
:: \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/
::
:: Version: @bat.file.version
::
::
:: Starts GridGain Visor Console.
::
@echo off
if "%OS%" == "Windows_NT" setlocal
:: Check JAVA_HOME.
if not "%JAVA_HOME%" == "" goto checkJdk
echo %0, ERROR: JAVA_HOME environment variable is not found.
echo %0, ERROR: Please create JAVA_HOME variable pointing to location of JDK 1.7 or JDK 1.8.
echo %0, ERROR: You can also download latest JDK at: http://java.sun.com/getjava
goto error_finish
:checkJdk
:: Check that JDK is where it should be.
if exist "%JAVA_HOME%\bin\java.exe" goto checkJdkVersion
echo %0, ERROR: The JDK is not found in %JAVA_HOME%.
echo %0, ERROR: Please modify your script so that JAVA_HOME would point to valid location of JDK.
goto error_finish
:checkJdkVersion
"%JAVA_HOME%\bin\java.exe" -version 2>&1 | findstr "1\.[78]\." > nul
if %ERRORLEVEL% equ 0 goto checkGridGainHome1
echo %0, ERROR: The version of JAVA installed in %JAVA_HOME% is incorrect.
echo %0, ERROR: Please install JDK 1.7 or 1.8.
echo %0, ERROR: You can also download latest JDK at: http://java.sun.com/getjava
goto error_finish
:: Check GRIDGAIN_HOME.
:checkGridGainHome1
if not "%GRIDGAIN_HOME%" == "" goto checkGridGainHome2
pushd "%~dp0"/..
set GRIDGAIN_HOME=%CD%
popd
:checkGridGainHome2
:: Strip double quotes from GRIDGAIN_HOME
set GRIDGAIN_HOME=%GRIDGAIN_HOME:"=%
:: remove all trailing slashes from GRIDGAIN_HOME.
if %GRIDGAIN_HOME:~-1,1% == \ goto removeTrailingSlash
if %GRIDGAIN_HOME:~-1,1% == / goto removeTrailingSlash
goto checkGridGainHome3
:removeTrailingSlash
set GRIDGAIN_HOME=%GRIDGAIN_HOME:~0,-1%
goto checkGridGainHome2
:checkGridGainHome3
if exist "%GRIDGAIN_HOME%\config" goto checkGridGainHome4
echo %0, ERROR: GridGain installation folder is not found or GRIDGAIN_HOME environment variable is not valid.
echo Please create GRIDGAIN_HOME environment variable pointing to location of
echo GridGain installation folder.
goto error_finish
:checkGridGainHome4
::
:: Set SCRIPTS_HOME - base path to scripts.
::
set SCRIPTS_HOME=%GRIDGAIN_HOME%\bin
:: Remove trailing spaces
for /l %%a in (1,1,31) do if /i "%SCRIPTS_HOME:~-1%" == " " set SCRIPTS_HOME=%SCRIPTS_HOME:~0,-1%
if /i "%SCRIPTS_HOME%\" == "%~dp0" goto run
echo %0, WARN: GRIDGAIN_HOME environment variable may be pointing to wrong folder: %GRIDGAIN_HOME%
:run
::
:: Set GRIDGAIN_LIBS
::
call "%SCRIPTS_HOME%\include\setenv.bat"
set CP=%GRIDGAIN_HOME%\bin\include\visor-common\*;%GRIDGAIN_HOME%\bin\include\visorcmd\*;%GRIDGAIN_LIBS%
::
:: Parse command line parameters.
::
call "%SCRIPTS_HOME%\include\parseargs.bat" %*
if %ERRORLEVEL% neq 0 (
echo Arguments parsing failed
exit /b %ERRORLEVEL%
)
::
:: Set program name.
::
set PROG_NAME=gridgain.bat
if "%OS%" == "Windows_NT" set PROG_NAME=%~nx0%
::
:: JVM options. See http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for more details.
::
:: ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE
::
if "%JVM_OPTS_VISOR%" == "" set JVM_OPTS_VISOR=-Xms1g -Xmx1g -XX:MaxPermSize=128M
::
:: Uncomment to set preference to IPv4 stack.
::
:: set JVM_OPTS_VISOR=%JVM_OPTS_VISOR% -Djava.net.preferIPv4Stack=true
::
:: Assertions are disabled by default since version 3.5.
:: If you want to enable them - set 'ENABLE_ASSERTIONS' flag to '1'.
::
set ENABLE_ASSERTIONS=0
::
:: Set '-ea' options if assertions are enabled.
::
if %ENABLE_ASSERTIONS% == 1 set JVM_OPTS_VISOR=%JVM_OPTS_VISOR% -ea
::
:: Starts Visor console.
::
"%JAVA_HOME%\bin\java.exe" %JVM_OPTS_VISOR% -DGRIDGAIN_PROG_NAME="%PROG_NAME%" ^
-DGRIDGAIN_DEPLOYMENT_MODE_OVERRIDE=ISOLATED %QUIET% %JVM_XOPTS% -cp "%CP%" ^
org.gridgain.visor.commands.VisorConsole
:error_finish
if not "%NO_PAUSE%" == "1" pause
goto :eof