eclipse 中的 glassfish 似乎没有看到我的 JDK
我试图让 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
确保jdk已安装。查看
C:\Program Files\Java\jdk1.6.XXXX
(我的是0_16)。如果里面有东西,那么jdk可能已经安装了,如果没有,你可以从http://java获取jdk .sun.com/javase/downloads/index.jsp这是错误消息有点奇怪的地方。
窗口>首选项
标准虚拟机
,然后选择下一步C:\Program Files\Java\jdk1.6.XXXX
其余部分应自动填写。点击“完成”。仍在“首选项”窗口中。 (可能必须点击“确定”,然后重新打开“首选项”窗口)
转至服务器视图(可能位于控制台视图下方)。
右键单击 Bundled Glassfish...Server 并点击重新启动/启动...
希望这可以修复它...
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.jspThis is where the error message kinda foobars ya.
Window>Preferences
Standard VM
then NextC:\Program Files\Java\jdk1.6.XXXX
the rest should fill in automagically. Hit Finish.Still in Preference Window. (May have to hit Okay, and re-open Preference window)
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...
尝试将 Eclipse 设置为在 JDK 中运行——也许 Glassfish 会选择它的 JDK。为此,请编辑 eclipse.ini,并添加行
使用此配置,我从未遇到过此问题。
Try setting Eclipse running in JDK as well — maybe Glassfish picks its JDK. To do this, edit
eclipse.ini
, and add the lineWith this configuration, I never had this issue.
转到窗口 ->首选项->服务器->运行时环境。选择 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.
当您从 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
访问+服务器、运行时环境
选择 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