eclipse 中的 glassfish 似乎没有看到我的 JDK

发布于 2024-12-08 04:41:59 字数 403 浏览 0 评论 0原文

我试图让 glassfish 在 eclipse 中工作,并遇到 JRE vs JDK 错误:

GlassFish v3 需要 JDK 1.6,而不是 JRE。请添加/选择 在服务器属性“运行时环境”部分中更正 JDK。

我用谷歌搜索了一下,似乎有很多人遇到了这个问题。果然在偏好设置->服务器->运行时环境 当我在 glassfish 服务器运行时环境上单击“编辑”时,JRE 是“默认 JRE”。我单击下拉菜单并将其切换到我的 JDK:java-6-openjdk,并认为我已经解决了问题。不幸的是,我仍然收到完全相同的错误。这让我不知道如何用 google 搜索这个问题,因为其他人似乎都通过将 JRE 切换到 JDK 来解决了这个问题。有人有什么想法吗?

阿凡达

I am trying to get glassfish working in eclipse, and running into the JRE vs JDK error:

GlassFish v3 requires a JDK 1.6 and not a JRE. Please add/select the
correct JDK in the Server properties 'Runtime Environment' section.

I googled around and it seems a bunch of people had this issue. Sure enough in preferences->Server-> Runtime Environment when I clicked edit on the glassfish server runtime environment the JRE was "default JRE". I clicked the dropdown menu and switched it to my JDK: java-6-openjdk and figured I had the problem solved. Unfortunately, I am still getting the exact same error. This leaves me at a loss on how to google the issue since everyone else seems to have resolved it by just switching the JRE to a JDK. Does anyone have any thoughts?

Avtar

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

一瞬间的火花 2024-12-15 04:41:59
  1. 确保jdk已安装。查看C:\Program Files\Java\jdk1.6.XXXX(我的是0_16)。如果里面有东西,那么jdk可能已经安装了,如果没有,你可以从http://java获取jdk .sun.com/javase/downloads/index.jsp

  2. 这是错误消息有点奇怪的地方。

    • 启动 eclipse,忽略该消息。
    • 转到窗口>首选项
    • 然后在“+Java+Installed JREs”下点击“添加”。
    • 选择标准虚拟机,然后选择下一步
    • JRE Home = C:\Program Files\Java\jdk1.6.XXXX 其余部分应自动填写。点击“完成”。
    • 最重要!在新的 jdk 运行时的“首选项”窗口中单击复选框...我不知道为什么有必要,但它确实是...
  3. 仍在“首选项”窗口中。 (可能必须点击“确定”,然后重新打开“首选项”窗口)

    • 访问+服务器、运行时环境
    • 选择 Glassfish SRE,点击“编辑...”
    • 从 JRE 下拉列表中获取 JDK 并点击“完成”
    • 点击“确定”。
  4. 转至服务器视图(可能位于控制台视图下方)。
    右键单击 Bundled Glassfish...Server 并点击重新启动/启动...

希望这可以修复它...

  1. make sure the jdk is installed. Look in C:\Program Files\Java\jdk1.6.XXXX (mine says 0_16). If that has stuff in it the jdk probably was installed, if not you can grab just the jdk from http://java.sun.com/javase/downloads/index.jsp

  2. This is where the error message kinda foobars ya.

    • Get eclipse started, ignore the message.
    • Go to Window>Preferences
    • Then under +Java+Installed JREs hit Add.
    • Select Standard VM then Next
    • JRE Home = C:\Program Files\Java\jdk1.6.XXXX the rest should fill in automagically. Hit Finish.
    • MOST IMPORTANT! Click the check box back in the Preferences Window for the new jdk runtime...I don't know why it's necessary, but it definitely is...
  3. Still in Preference Window. (May have to hit Okay, and re-open Preference window)

    • Get to +Server, Runtime Environments
    • Select the Glassfish SRE, hit Edit...
    • From the JRE drop down grab the JDK and hit Finish
    • Hit Okay.
  4. Go to the Servers Veiw (probably down by the Console View).
    Right click on the Bundled Glassfish...Server and hit restart/start...

Hopefuly this fixes it...

血之狂魔 2024-12-15 04:41:59

尝试将 Eclipse 设置为在 JDK 中运行——也许 Glassfish 会选择它的 JDK。为此,请编辑 eclipse.ini,并添加行

 -vm 
 path-to-javaw.exe-in-a-JDK

使用此配置,我从未遇到过此问题。

Try setting Eclipse running in JDK as well — maybe Glassfish picks its JDK. To do this, edit eclipse.ini, and add the line

 -vm 
 path-to-javaw.exe-in-a-JDK

With this configuration, I never had this issue.

旧梦荧光笔 2024-12-15 04:41:59

转到窗口 ->首选项->服务器->运行时环境。选择 GlassFish xxx 单击编辑并在 JRE 选项中选择已安装的 JDK。
如果您在选项中看不到 JDK,请转到“窗口”->“JDK”。首选项->安装 JRE 并单击“添加...”并浏览到要添加的 JDK 文件夹。

Go to Window -> Preferences -> Server -> Runtime Environment. Select GlassFish x.x.x click Edit and select the installed JDK in JRE option.
If you couldn't see JDK in the options, goto Window -> Preferences -> installed JREs and click Add... and browse to JDK folder you want to add.

此刻的回忆 2024-12-15 04:41:59

当您从 Eclipse 启动 glassfish 时,只需点击“确定”即可,因为它要求输入用户名和密码。输入用户名和密码 10 次后,我仍然无法登录。因此,只需点击“确定”即可,无需输入您的姓名并通过

simple hit ok when you'll start glassfish from eclipse , as it is asking for username and password . after 10 times typing my username and password i was still out. so , simple hit ok without entering your name and pass

耶耶耶 2024-12-15 04:41:59

访问+服务器、运行时环境
选择 Glassfish SRE,点击编辑...
从 JRE 下拉菜单中获取 JDK 并点击 Finish
点击“好的”。对我来说效果很好

Get to +Server, Runtime Environments
Select the Glassfish SRE, hit Edit...
From the JRE drop down grab the JDK and hit Finish
Hit Okay.Worked well for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文