The subject of Java licensing is a long and complicated story, but today, most major components of Java are available under open source licenses, and those which are not available under open licenses typically have drop-in replacements which are open. Sun, the original developers of Java, placed much of Java under the GNU General Public License in 2006. Projects like IcedTea filled in the gaps for the portions of the Java Development Kit not available under an open license, meaning today, it is possible to run Java applications without using any proprietary code.
Since Java 9, the language has been moving toward a modular design. Many modern Java applications bundle a small Java module as part of the software itself. This means there are some applications you can run without even downloading Java. This is by no means universal yet, however. To run many Java applications, you must have a Java runtime environment (JRE) installed. Because Java is open source, there isn't just one JRE, so you can choose the JRE that best suits your needs. Linux distributions typically provide an OpenJDK or IcedTea JRE. Windows users can download a JRE installer from Red Hat's Developer portal. MacOS (and Windows and Linux) users can also download JRE installers from OpenJDK.java.net or the Zulu community at Azul. Because the JRE you install has been created specifically for your OS, any Java application can run on your computer. By installing Java, you provide your system with a layer (technically a Java virtual machine, or JVM) upon which any Java application can run.
Java was originally developed and supported by Sun Microsystems and is now supported by Oracle. However, Java is open source and has a worldwide community invested in guiding its continued development and growth. The use cases for Java may change over the years