Your answer surprised me and I went to do a bit of reading. Found this quote:
> Since this article was first published, Sun (now part of Oracle) has relicensed most of its Java platform reference implementation under the GNU General Public License, and there is now a free development environment for Java. Thus, the Java language as such is no longer a trap.
So it looks like at least older versions of Java were under the GPL. Apparently you can't use the name "Java" without passing a conformation testing suite, but you should be okay as long as you didn't call it Java, (say calling it Android).
Open source licenses are enforced by copyright; without owning the copyright of a work there's not much you are able to license with respect to copying. There's a reason most license files out there start with "(c) 2019 <Authors>".
The opposite of a copyrighted work is not an open sourced work: it's a work in the public domain.
> So that would mean that Android would have to be under GPL, right?
That kind of depends on whether you can apply a different license to an API and its implementation. There's not really any precedent for that kind of question, because it presupposes the validity of a kind of copyright that the industry has grown up assuming is not valid.
AFAIK Android originally didn't use OpenJDK, but rather Apache Harmony, which is an IBM reimplementation of the Java JDK. So in that sense maybe Oracle does have a point (if API's are deemed to be copyrightable).
I think Android has since switched to OpenJDK, so it seems to me what Oracle and Google are arguing about is whether Google owes Oracle some damages for their previous use of Harmony. And of course, the lawsuit could have larger repercussions as well, if API's are deemed to be copyrightable.