问题描述
我正在跑步:
- 面向 Web 开发人员的 Eclipse Java EE IDE.
- 版本:Helios Service Release 2
- 版本号:20110218-0911
我还安装了 Java EE 6 SDK Update 2,其中包括:
I have also installed Java EE 6 SDK Update 2 which includes:
- GlassFish 开源版 3.1
- Java EE 6 代码示例
- Java EE 6 API 文档
- Java EE 6 教程
- 您的第一杯:Java EE 平台简介
我已经在 Eclipse 中注册了 GlassFish,但是当我尝试启动服务器时,我收到以下错误:
I have registered GlassFish with Eclipse but when I try to start the server, I get the following error:
GlassFish v3 需要 JDK 1.6 而不是 JRE.请在服务器属性运行时环境"部分添加/选择正确的 JDK.
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 have searched here for an answer but none so far seem to work. Can anybody suggest how I would sort this error out?
推荐答案
是的,您下载(或将 Eclipse 指向)一个 JRE,但它需要一个 JDK.后者拥有所有Java工具:javac.exe、java.exe、jar.exe等.
Yes, you downloaded (or pointed Eclipse to) a JRE, but it needs a JDK. The latter has all the Java tools: javac.exe, java.exe, jar.exe, etc.
如果您查看您告诉 Eclipse 查找 JDK 的目录,您必须看到一个/bin 目录,其中包含这些 .exe 文件.如果不知道,您就知道错误消息的原因.
If you look at the directory where you told Eclipse to look for a JDK, you must see a /bin directory with those .exe files in it. If you don't, you know why the error message.
确保您下载了 JDK 并将 Eclipse 指向它.
Make sure you downloaded a JDK and point Eclipse to it.
再检查一下:看看您是否可以在没有 Eclipse 的情况下启动 Glassfish.如果你同时学习这两件事,你就对两件事一无所知.在您可以让 Glassfish 自行运行之前,不要考虑一个未知数.
One more check: see if you can start Glassfish without Eclipse. You're ignorant of two things if you're learning both at the same time. Leave one unknown out of the equation until you can make Glassfish run on its own.
您需要一个 JAVA_HOME 环境变量.它指向什么?如果您没有,请创建它.
You need a JAVA_HOME environment variable. What's it pointing to? If you don't have one, create it.
这篇关于Eclipse 中的 GlassFish 抱怨“GlassFish v3 需要 JDK 1.6 而不是 JRE".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!