The WildFly zip itself does not include a JDK or JRE. And there's no need to pay to use the software in WildFly.
You of course need a JDK or JRE to run WildFly, but there is no requirement to use one that you pay for. For example the ones from https://adoptopenjdk.net/ are fine.
I thought it was the same as the Glassfish in which it is included Java inside and from another hand I don't know if you have to pay for glassfish because it contains Java.
It is the same as in Glassfish indeed.
The JavaEE specs are supported by WildFly.
Btw JavaEE had been renamed to Jakarta EE when moving the project to the Eclipse Foundation.
Eclipse GlassFish 5.1 - Full Platform : is free ?
I am not sure understanding your question correctly.
But the Wildfly server is released under "GNU LESSER GENERAL PUBLIC LICENSE"
As mentioned at WildFly Homepage · WildFly
"All dependencies of this project are available under the LGPL or a compatible license"
wildfly/LICENSE.txt at master · wildfly/wildfly · GitHub
The question is exactly this: do we have to pay for java using jBoss or Glassfish????
This is not a Glassfish forum. But as you may read on the Glassfish download page Glassfish 5 is licensed under the COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL). As mentioned above WildFly is licensed under "GNU LESSER GENERAL PUBLIC LICENSE".
Both licenses allow to download the JEE software and use ist with no license costs.
When referring to the Java language (JDK, JRE) which is required fo running the JEE Server, as mentioned by Brian the license cost depends on the version you are using. Please refer eg for the 'Oracle Technology Network License Agreement for Oracle Java SE' (Oracle Java SE License ) for commercial licenses