glassfish in eclipse doesn't seem to see my JDK
I am trying to get glassfish working in eclipse, and running into the JRE vs JDK error:
GlassFish v3 requir开发者_JAVA技巧es 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
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.
- 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...
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.
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...
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.
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.
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
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
精彩评论