Use correct Java version for JVM dependency repos.
Created by: olafurpg
Previously, we used Java 8 for all JVM dependencies. This meant that a Java 11 library would fail to index. This commit fixes that issue by reading the classfiles of the given JVM dependency to infer the actual version of the JVM that it's compatible with.
Fixes #21882 (closed).