What ever I tried even upgrade to zulu jdk 17 the error message persists. openhab@macos never tried to load jdk17
"Unable to find any JVMs matching version “11”.
but
java -version
openjdk version “17.0.8.1” 2023-08-24 LTS
OpenJDK Runtime Environment Zulu17.44+53-CA (build 17.0.8.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu17.44+53-CA (build 17.0.8.1+1-LTS, mixed mode, sharing)
and
./start.sh
Launching the openHAB runtime…
Unable to find any JVMs matching version “11”.
Do you have more than one Java version installed ?
If this is the case is it possble to remove JDK11 ?
If not can you try to force using 17 by setting environment variables like JAVA_HOME that points to version 17 ?
Did you check /etc/profile for version specific configurations? If I search for your error message it seems to be one of the places which may need to be updated.
Thank you for that trial. I did expect it to show more.
So we need to check something else. What is shown by executing:
/usr/libexec/java_home -V
Could you further check the following. In directory … you should find a file setenv.
In the download from openhab.org I see this code
locateJava() {
# Setup the Java Virtual Machine
if ${cygwin} ; then
[ -n "${JAVA}" ] && JAVA=$(cygpath --unix "${JAVA}")
[ -n "${JAVA_HOME}" ] && JAVA_HOME=$(cygpath --unix "${JAVA_HOME}")
fi
if [ "x${JAVA_HOME}" = "x" ] && [ "${darwin}" = "true" ]; then
JAVA_HOME="$(/usr/libexec/java_home -v 11)"
fi
if [ "x${JAVA}" = "x" ] && [ -r /etc/gentoo-release ] ; then
JAVA_HOME=$(java-config --jre-home)
fi
if [ "x${JAVA}" = "x" ]; then
if [ "x${JAVA_HOME}" != "x" ]; then
if [ ! -d "${JAVA_HOME}" ]; then
die "JAVA_HOME is not valid: ${JAVA_HOME}"
fi
JAVA="${JAVA_HOME}/bin/java"
else
JAVA=$(command -v java)
if [ "x${JAVA}" = "x" ]; then
die "java command not found"
fi
fi
fi
if [ "x${JAVA_HOME}" = "x" ]; then
JAVA_HOME="$(dirname "$(dirname "$(pathCanonical "${JAVA}")")")"
fi
}
Pay attention to the row that contains
JAVA_HOME="$(/usr/libexec/java_home -v 11)"
That row is only executed if JAVA_HOME is not set and it then will set JAVA_HOME to use version 11.
Could you try to set JAVA_HOME to the correct directory to prevent this row from being executed.