I have NetBeans 17 and the highest GlassFish version is 7.0.0. I have Java JDK 19 installed but GlassFish tells me it is not compatible with JDK 19.
What version of JDK is suitable for GlassFish 7.0.0 or lower?
I can reproduce your problem. I just tried to start GlassFish 7 on NetBeans 17 using JDK 20, and NetBeans wouldn't let me do that. But when I selected JDK 17 instead it worked fine. So to resolve this:
Use Tools > Java Platforms... > Add Platform to add JDK 17 as a platform in NetBeans.
Download and install the latest release of GlassFish 7: version 7.0.4.
When you try to start GlassFish 7.0.4 as a server within NetBeans it will fail ("GlassFish server could not be started..."), but NetBeans should then invite you to select an alternative platform to use instead:
Note that if JDK 19 is your only platform in NetBeans you won't be given the option to select an alternative platform, and you won't be able to resolve the issue.
Just select JDK 17 as your Java Platform and click OK and everything should work. I am running GlassFish 7 on JDK 17 within NetBeans 17 which is using JDK 20 and it is working. Using JDK 18 instead also worked for me.
See the Eclipse GlassFish download page for details on the latest releases and their JDK requirements. It looks like all releases of GlassFish 7 formally support the use of JDK19.
Notes:
ResolveError
in the GlassFish log, and you won't be able to open the Admin Console, typically from http://localhost:4848/common/index.jsf
.