Can Glassfish 5 run with java 10 or is it only compatible with java 8?

Viewed 16887

getting error when installing Glassfish 5. I have jdk-10.0.2, now I want to know if this is because there is no compatibility between them.

Am running "asadmin start-domain" and then am getting this error:

Exception in thread "main" java.lang.NullPointerException
        at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.ini
tializeServiceLocator(AbstractModulesRegistryImpl.java:152)
        at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.new
ServiceLocator(AbstractModulesRegistryImpl.java:144)
        at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.cre
ateServiceLocator(AbstractModulesRegistryImpl.java:218)
        at com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl.cre
ateServiceLocator(AbstractModulesRegistryImpl.java:224)
        at com.sun.enterprise.module.single.StaticModulesRegistry.createServiceL
ocator(StaticModulesRegistry.java:88)
        at com.sun.enterprise.admin.cli.CLIContainer.getServiceLocator(CLIContai
ner.java:217)
        at com.sun.enterprise.admin.cli.CLIContainer.getLocalCommand(CLIContaine
r.java:255)
        at com.sun.enterprise.admin.cli.CLICommand.getCommand(CLICommand.java:23
1)
        at com.sun.enterprise.admin.cli.AdminMain.executeCommand(AdminMain.java:
371)
        at com.sun.enterprise.admin.cli.AdminMain.doMain(AdminMain.java:306)
        at org.glassfish.admin.cli.AsadminMain.main(AsadminMain.java:57)

Thanks for you guide in anticipation
4 Answers

Glassfish has moved to Eclipse: https://projects.eclipse.org/projects/ee4j.glassfish/downloads

It is also Eclipse that Oracle "sold" javaEE to.

But it is still not supporting JDK 9+

Edit: Glassfish 6.0 is out - but it is still only supporting JDK 8

Edit: Glassfish 6.1 is out - and it is now supporting JDK 11

Support for Java 11 is coming with GlassFish 6, expected to be released in June 2020. But this is a release to support JakartaEE only, as it's clearly stated at the previous link to the official Eclipse GlassFish website.

GlassFish 6.0 will move the Jakarta apis into the jakarta namespace as required by Jakarta EE 9. This will be a breaking change for all applications. GlassFish 6.0.0 will support JDK 11+. Support for JDK 8 is not a goal for GlassFish 6.0.0. [1]

The home page doesn't show any plans to support JDK 11 for running JavaEE 8 applications. If you want to do that, consider migrating to Payara Server. It's derived from GlassFish and Payara 5.194 enables that.

i'm working with glassfish 5.1, Glassfish has moved to Eclipse , https://projects.eclipse.org/projects/ee4j.glassfish/downloads notice: you have to install jdk8

next you have to ceate /usr/lib/systemd/system/glassfish.service,

vi /usr/lib/systemd/system/glassfish.service
cat /usr/lib/systemd/system/glassfish.service
[Unit]
Description = GlassFish Server v5.0
After = syslog.target network.target

[Service]
User = glassfish
ExecStart = /usr/java/jdk1.8.0_221-amd64/bin/java -jar /opt/glassfish5/glassfish/lib/client/appserver-cli.jar start-domain
ExecStop = /usr/java/jdk1.8.0_221-amd64/bin/java -jar /opt/glassfish5/glassfish/lib/client/appserver-cli.jar stop-domain
ExecReload = /usr/java/jdk1.8.0_221-amd64/bin/java -jar /opt/glassfish5/glassfish/lib/client/appserver-cli.jar restart-domain
Type = forking

[Install]
WantedBy = multi-user.target

then Reload systemd manager,

systemctl daemon-reload

and start glassfish.service

systemctl start glassfish.service

enter image description here

Related