There're several different JRE available with different licenses. Two most prominent are:
OpenJDK is open-source (GPL). You can use it without having to pay for it.
Oracle JRE use different license (https://www.oracle.com/downloads/licenses/oracle-javase-license.html). I am not a lawyer, but as far as I understand, it is still free for usage.
As for JDK, ...