this repo has no description
1@echo off
2setlocal enabledelayedexpansion
3
4echo Checking for Java...
5
6@rem Check if Java is installed
7java -version 2>nul >nul
8if %errorlevel% neq 0 (
9 echo.
10 echo ERROR: Java is not installed or not in PATH.
11 echo You must install Java ^(version ^>= 17^) to run Star Rod:
12 echo https://www.oracle.com/java/technologies/downloads/
13 pause >nul
14 exit /b 1
15)
16
17@rem Extract the Java version string
18for /f "tokens=3 delims= " %%A in ('java -version 2^>^&1 ^| findstr /i "version"') do (
19 set "java_version=%%~A"
20)
21
22@rem Extract the major version number
23for /f "tokens=1 delims=." %%A in ("%java_version%") do set "java_major=%%A"
24
25echo Detected Java version: %java_version%
26
27@rem Check if the major version is >= 17
28if %java_major% lss 17 (
29 echo.
30 echo ERROR: Star Rod requires Java version 17 or greater.
31 echo Install a more recent version of Java to run Star Rod:
32 echo https://www.oracle.com/java/technologies/downloads/
33 pause >nul
34 exit /b 1
35)
36
37if not exist "StarRod.jar" (
38 echo.
39 echo ERROR: StarRod.jar not found in the current directory.
40 echo Please ensure that StarRod.jar is located in the same folder as this script.
41 pause >nul
42 exit /b 1
43)
44
45@rem Valid Java version detected, launch Star Rod
46start "" javaw -jar -mx2G StarRod.jar