Google used the Apache Harmony version as the basis for Android (Until Nougat).
Some of the argument was over whether the Apache licence inherited by Google from Harmony was valid, or whether Harmony itself was in breach of copyright (and therefore had no valid licence Google could use).
Once the courts decided APIs are copyrightable the argument switched to whether Google's was Fair-Use, with a jury saying it was, federal appeals court saying no, and thus it ended up at the Supreme court.
Here's a Groklaw [0] copy of an early (April 2012) Oracle argument asking for Jury instructions around the licence topic that explains it well:
"As made clear by Apache itself, Apache never had a license from Sun or Oracle for Harmony. Apache had no rights to Java technology that it could give to Google"
So the original case had claims against copying more of the original Sun JVM code than just the API--the entire furor over "rangeCheck" was a key part of the original case. By the first appeal, this was reduced to a de minimis claim of copyright and Oracle no longer pursued claims of copyright on anything but the API.
My understanding is that all of the APIs in question are shared between the (now-Oracle) JVM and the OpenJDK implementation. (Indeed, I think the actual implementation of the Java code in question is the same between the closed and open source versions, it's only the JVM itself that differs.)
IIRC the API is probably licensed under the Apache license (by virtue of client libraries being licensed, not intentionally) but Oracle isn't complying with the requirements of the license, so that would have been more or less irrelevant.