Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check that JVM version is 17 #1589

Merged
merged 1 commit into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion distributions/openhab/src/main/resources/bin/karaf
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ init() {
# Determine the JVM vendor
detectJVM

# Determine the JVM version >= 1.6
# 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)"
fi

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

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% GTR 8 (
pushd "%KARAF_HOME%\lib\jdk9plus"
for %%G in (*.jar) do call:APPEND_TO_JDK9PLUS_CLASSPATH %%G
Expand Down