forked from rty1966/Erachain_alpha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-develop-cli.bat
51 lines (37 loc) · 1.93 KB
/
run-develop-cli.bat
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
@ECHO OFF
set app=erachain-dev
set args=-cli
IF EXIST java (
start "%app%" java -Xms512m -Xmx1024m -jar %app%.jar %args%
rem EXIT /b
)
REG QUERY "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.7" /v "JavaHome" >nul 2>nul || ( GOTO NOTFOUND1 )
for /f "tokens=1,2,*" %%a in ('reg query "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.7" /v "JavaHome"') do if "%%a"=="JavaHome" set JAVAHOME=%%c
IF EXIST "%JAVAHOME%\bin\java.exe" (
start "%app%" "%JAVAHOME%\bin\java.exe" -Xms512m -Xmx1024m -jar %app%.jar %args%
EXIT /b
)
:NOTFOUND1
REG QUERY "HKLM\SOFTWARE\WOW6432NODE\JavaSoft\Java Runtime Environment\1.7" /v "JavaHome" >nul 2>nul || ( GOTO NOTFOUND2 )
for /f "tokens=1,2,*" %%a in ('reg query "HKLM\SOFTWARE\WOW6432NODE\JavaSoft\Java Runtime Environment\1.7" /v "JavaHome"') do if "%%a"=="JavaHome" set JAVAHOME=%%c
IF EXIST "%JAVAHOME%\bin\java.exe" (
start "%app%" "%JAVAHOME%\bin\java.exe" -Xms512m -Xmx1024m -jar %app%.jar %args%
EXIT /b
)
:NOTFOUND2
REG QUERY "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.8" /v "JavaHome" >nul 2>nul || ( GOTO NOTFOUND3 )
for /f "tokens=1,2,*" %%a in ('reg query "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.8" /v "JavaHome"') do if "%%a"=="JavaHome" set JAVAHOME=%%c
IF EXIST "%JAVAHOME%\bin\java.exe" (
start "%app%" "%JAVAHOME%\bin\java.exe" -Xms512m -Xmx1024m -jar %app%.jar %args%
EXIT /b
)
:NOTFOUND3
REG QUERY "HKLM\SOFTWARE\WOW6432NODE\JavaSoft\Java Runtime Environment\1.8" /v "JavaHome" >nul 2>nul || ( GOTO NOTFOUND4 )
for /f "tokens=1,2,*" %%a in ('reg query "HKLM\SOFTWARE\WOW6432NODE\JavaSoft\Java Runtime Environment\1.8" /v "JavaHome"') do if "%%a"=="JavaHome" set JAVAHOME=%%c
IF EXIST "%JAVAHOME%\bin\java.exe" (
start "%app%" "%JAVAHOME%\bin\java.exe" -Xms512m -Xmx1024m -jar %app%.jar %args%
EXIT /b
)
:NOTFOUND4
ECHO Java software not found on your system. Please go to http://java.com to download a copy of Java.
PAUSE