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

半城伤御伤魂 提交于 2019-12-23 12:51:04

问题


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

回答1:


At the moment GlassFish 5 is not compatible with JDK 9 nor 10. The support for JDK 9 will come with the next update as stated at end of https://blogs.oracle.com/theaquarium/java-ee-8-is-final-and-glassfish-50-is-released




回答2:


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

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

But it is still not supporting JDK 9+




回答3:


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



来源:https://stackoverflow.com/questions/52411138/can-glassfish-5-run-with-java-10-or-is-it-only-compatible-with-java-8

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!