forked from babelfish-for-postgresql/babelfish_compass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BabelfishCompass.bat
89 lines (61 loc) · 2.04 KB
/
BabelfishCompass.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
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
@echo off
rem ------------------------------------------------------------------
rem Babelfish Compass
rem Compatibility assessment tool for Babelfish for PostgreSQL
rem ------------------------------------------------------------------
rem Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
rem SPDX-License-Identifier: Apache-2.0
rem ------------------------------------------------------------------
title Babelfish Compass
rem ----------------------------------------------------
set THISPROG=%~n0%~x0
rem ----------------------------------------------------
SET COMPASS=%cd%
rem Check:
if exist %COMPASS% (
rem OK
) else (
echo %COMPASS% not found
goto end
)
rem ----------------------------------------------------
goto start
:usage
echo.
echo For usage info, run:
echo %THISPROG% -help
echo.
goto end
rem ----------------------------------------------------
:start
if "%1" == "" (
goto usage
)
rem ---------------------------------------------------
rem Check for Java 8 or later
set TMPFILE=%TEMP%\compass.tmp.txt
java.exe -d64 -fullversion 2> %TMPFILE%
IF %ERRORLEVEL% NEQ 0 (
echo 64-bit Java/JRE not found. Please install 64-bit JRE 8 or later
goto end
)
for /F "tokens=4" %%i IN (%TMPFILE%) DO SET JAVA_VERSION=%%i
for /F "tokens=1 delims=." %%i IN (%JAVA_VERSION%) DO SET JAVA_VERSION_CHK=%%i
if %JAVA_VERSION_CHK% EQU 1 (
for /F "tokens=2 delims=." %%i IN (%JAVA_VERSION%) DO SET JAVA_VERSION_CHK=%%i
)
if %JAVA_VERSION_CHK% LSS 8 (
echo Babelfish Compass requires 64-bit Java/JRE 8 or later. Java version found: %JAVA_VERSION_CHK%
echo Run 'java -version' and verify the version ID starts with '1.8' or later
goto end
)
goto invoke
rem ----------------------------------------------------
:invoke
rem assume Java is in the PATH, this was tested above
rem assuming 12GB is enough
java -server -Xmx12g -enableassertions -jar compass.jar %*
rem ----------------------------------------------------
:end
rem pause Hit any key to continue....
rem ----------------------------------------------------