Skip to content

Commit

Permalink
karaf scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Holger Friedrich <[email protected]>
  • Loading branch information
holgerfriedrich committed Mar 25, 2024
1 parent d39aa87 commit f5cb08c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion distributions/openhab/src/main/resources/bin/karaf
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ init() {
# Determine the JVM version and check that it is version 17
checkJvmVersion
if [ "${VERSION}" -ne "17" ]; then
die "JVM must be version 17. JVM version ${VERSION} is unsupported (JAVA_HOME=$JAVA_HOME)"
if [ "${VERSION}" -ne "21" ]; then
die "JVM must be version 17 or 21. JVM version ${VERSION} is unsupported (JAVA_HOME=$JAVA_HOME)"
fi
fi

# Check if a root instance is already running
Expand Down
6 changes: 4 additions & 2 deletions distributions/openhab/src/main/resources/bin/karaf.bat
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ for /f tokens^=2-5^ delims^=.-_+^" %%j in ('"%JAVA%" -fullversion 2^>^&1') do (
)

if %JAVA_VERSION% NEQ 17 (
call :warn "JVM must be version 17. JVM version %JAVA_VERSION% is unsupported (JAVA_HOME=%JAVA_HOME%)"
goto END
if %JAVA_VERSION% NEQ 21 (
call :warn "JVM must be version 17 or 21. JVM version %JAVA_VERSION% is unsupported (JAVA_HOME=%JAVA_HOME%)"
goto END
)
)

if %JAVA_VERSION% GTR 8 (
Expand Down

0 comments on commit f5cb08c

Please sign in to comment.