0

I'm trying to make a web application in the netbeans ide, after writing my code and running the project I get the error "Glassfish server could not be started with JDK 18 (Default). Please select another Java SE platform". Should I install another version of java? Which version of java should I install? Or what should I do to solve this error

  • 2
    Notice the Java versions in the [documentation](https://glassfish.org/). It looks like it wasn't until GlassFish 6.2.2 that it became at least somewhat compatible with Java 18 (at least early-access versions). Your version of GlassFish (6.2.1) is only compatible with Java 11 to 17 (not 18). Either downgrade Java to 17 (which is an LTS version), or upgrade GlassFish (the latest appears to be 6.2.5). – Slaw Aug 08 '22 at 18:39
  • downgrade? Do you mean install jdk 11 to 17? – Robert Mdee Aug 08 '22 at 18:48
  • 2
    No, I mean install one of Java 11, 12, 13, 14, 15, 16, or 17. Preferably 17, as it's the latest LTS release. But Java 11 is also an LTS release. Note LTS stands for "long term service". – Slaw Aug 08 '22 at 19:40
  • 1
    NetBeans 14 running with JDK 17 and GlassFish 6.1.0 is definitely a working combination. See [this answer](https://stackoverflow.com/a/72795916/2985643) to [Cannot add Glassfish server to Netbeans IDE 14](https://stackoverflow.com/q/72793527/2985643). Since Java 18 was released on 3/2/22, it's unwise and unreasonable to expect GlassFish versions released prior to that date to support JDK 18. – skomisa Aug 09 '22 at 01:28
  • Yes after installing jdk 17 and setting it as default it worked. – Robert Mdee Aug 09 '22 at 14:30

0 Answers0