The JDK is under the same license as Linux, so however closely you pay attention to the Linux legalese, that's as much attention you need to pay to Java's.
All JDKs built from the OpenJDK project have the same license as the OpenJDK project, which is GPLv2 with the Classpath Exception (that means the license does not infect Java programs running on top of the JDK).
(The same JDK is also offered by Oracle under a commercial license for those who wish to buy a support subscription from Oracle, and other companies license the code to make their own commerical JDKs, e.g. Azul's Zing).