exit 1
fi
-for jvm in java-7-openjdk-$arch java-7-openjdk \
- oracle-java7-jre-$arch oracle-java7-server-jre-$arch oracle-java7-jdk-$arch \
- java-8-openjdk-$arch java-8-openjdk \
- oracle-java8-jre-$arch oracle-java8-server-jre-$arch oracle-java8-jdk-$arch \
- java-9-openjdk-$arch java-9-openjdk \
- oracle-java9-jre-$arch oracle-java9-server-jre-$arch oracle-java9-jdk-$arch \
- java-10-openjdk-$arch java-10-openjdk \
- oracle-java10-jre-$arch oracle-java10-server-jre-$arch oracle-java10-jdk-$arch \
- java-11-openjdk-$arch java-11-openjdk \
- oracle-java11-jre-$arch oracle-java11-server-jre-$arch oracle-java11-jdk-$arch; do
- if [ -x /usr/lib/jvm/$jvm/bin/java ]; then
- export JAVA_HOME=/usr/lib/jvm/$jvm
- PATH=$JAVA_HOME/bin:$PATH
- break
- fi
+for version in 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
+ for jvm in \
+ java-${version}-openjdk-${arch} \
+ java-${version}-openjdk \
+ oracle-java${version}-jre-${arch} \
+ oracle-java${version}-server-jre-${arch} \
+ oracle-java${version}-jdk-${arch}
+ do
+ if [ -x /usr/lib/jvm/$jvm/bin/java ]; then
+ export JAVA_HOME=/usr/lib/jvm/$jvm
+ PATH=$JAVA_HOME/bin:$PATH
+ break 2
+ fi
+ done
done
if dpkg-query --version >/dev/null; then