GlassFish 7.0.0 在 Mac 上支持哪个版本的 Java?

huangapple go评论71阅读模式
英文:

What version of Java supports GlassFish 7.0.0 on a Mac?

问题

GlassFish 7.0.0或更低版本适用的JDK版本是多少?

英文:

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?

答案1

得分: 4

我可以重现您的问题。我刚刚尝试在NetBeans 17上使用JDK 20启动GlassFish 7,但NetBeans不允许我这样做。但是,当我选择了JDK 17时,一切正常。所以要解决这个问题:

  • 使用工具 > Java平台... > 添加平台,将JDK 17添加为NetBeans中的平台。

  • 下载并安装GlassFish 7的最新版本:版本7.0.4

  • 当您尝试在NetBeans中启动GlassFish 7.0.4作为服务器时,它会失败("无法启动GlassFish服务器..."),但NetBeans应该邀请您选择替代平台来使用:

    GlassFish 7.0.0 在 Mac 上支持哪个版本的 Java?

  • 请注意,如果JDK 19是您在NetBeans中唯一的平台,您将无法选择替代平台的选项,也无法解决此问题。

  • 只需选择JDK 17作为您的Java平台,然后单击确定,一切都应该正常工作。我正在在使用JDK 20的NetBeans 17中运行GlassFish 7,它正在工作。使用JDK 18也对我起作用。

有关最新版本及其JDK要求的详细信息,请参阅Eclipse GlassFish下载页面

注意:

  • 不要让NetBeans为您下载GlassFish 7.0.0;那只会导致问题。相反,创建一个空目录(例如C:/GlassFish704),然后自己下载并安装最新版本的GlassFish 7.0.4到该目录。然后,当您将GlassFish 7添加为服务器时,导航到该GlassFish 7.0.4安装的根目录。在我的情况下(在Windows上),该路径是C:/GlassFish704/glassfish-7.0.4/glassfish7

  • 不要使用GlassFish 7.0.0,因为与Admin Console无关的问题存在问题:"无法加载GlassFish Server Administration Console(http://localhost:4848)"。您将在GlassFish日志中看到ResolveError,并且通常无法打开Admin Console,通常是从http://localhost:4848/common/index.jsf

  • 我认为NetBeans中的一个小bug导致了您遇到此问题,因为NetBeans官方支持使用JDK 19。似乎有一个不必要的硬编码约束,阻止您在GlassFish 7.x.x中使用JDK 19。

英文:

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:

    GlassFish 7.0.0 在 Mac 上支持哪个版本的 Java?

  • 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:

  • Don't let NetBeans download GlassFish 7.0.0 for you; that is only going to lead to problems. Instead, create an empty directory (e.g. C:/GlassFish704), and then download and install the latest release, GlassFish 7.0.4, into that directory yourself. Then, when you add GlassFish 7 as a server, navigate to the root directory of that GlassFish 7.0.4 installation. In my case (on Windows) that path was C:/GlassFish704/glassfish-7.0.4/glassfish7

  • Do not use GlassFish 7.0.0 because there is an unrelated problem with the Admin Console: "GlassFish Server Administration Console (http://localhost:4848) cannot be loaded.". You will see a ResolveError in the GlassFish log, and you won't be able to open the Admin Console, typically from http://localhost:4848/common/index.jsf.

  • I think a minor bug in NetBeans caused you to hit this issue, since NetBeans does officially support the use of JDK 19. It seems that there is a needless hard coded constraint preventing you from using JDK 19 with GlassFish 7.x.x.

huangapple
  • 本文由 发表于 2023年5月11日 03:59:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76222165.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定