Java 如何在 Eclipse 中手动配置 Glassfish Server

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25200410/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 23:51:21  来源:igfitidea点击:

How to configure Glassfish Server in Eclipse manually

javaeclipseoracleconfigurationglassfish

提问by InCh

I have GlassFish server3.1.2.2 pre installed on my machine. Which I want to use in my Eclipse Luna

我的机器上预装了 GlassFish server3.1.2.2。我想在我的 Eclipse Luna 中使用

How do I manually configure it to use in Eclipse?

如何手动配置它以在 Eclipse 中使用?

When I tried using Eclipse Market Place i got an error No repository found at http://download.oracle.com/otn_software/oepe/luna.

当我尝试使用 Eclipse Market Place 时,出现错误 No repository found at http://download.oracle.com/otn_software/oepe/luna

I tried searching through net for which I get pointed to the Oracle Enterprise Pack for Eclipse (OEPE) which is of about 485MB.
Is there an another way round for this?

我尝试通过网络进行搜索,我指向了大约 485MB 的 Oracle Enterprise Pack for Eclipse (OEPE)。
有没有另一种方式来解决这个问题?

采纳答案by Do Nhu Vy

You must use Eclipse WTP(Web Tool Platform), and should use the lastest version is Luna 4.4. Link download: Eclipse IDE for Java EE Developers http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunar

您必须使用Eclipse WTP( Web Tool Platform),并且应该使用最新版本是 Luna 4.4。链接下载:面向 Java EE 开发人员的 Eclipse IDE http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunar

Menu Windows\Show view\Other, choose folder Server, click on Servers.

enter image description here

enter image description here

Right click on blank area to use context menu, choose New\Server

enter image description here

菜单Windows\Show view\Other,选择文件夹Server,点击Servers

在此处输入图片说明

在此处输入图片说明

右键单击空白区域以使用上下文菜单,选择New\Server

在此处输入图片说明

Press link "Download additional server adapters"

enter image description here

按链接“下载其他服务器适配器

在此处输入图片说明

Choose "GlassFish Tools" from Oracle vendor.

enter image description here

Then, restart Eclipse.

从 Oracle 供应商处选择“ GlassFish 工具”。

在此处输入图片说明

然后,重新启动 Eclipse。

回答by alvaro7710

I had the same problem, to resolve it, go windows -> preferences -> servers and select runtime environment, and now you will see a new window, in the upper right you will see a option: Download additional server adapter, click and install the glassfish server.

我遇到了同样的问题,要解决它,请转到 windows -> 首选项 -> 服务器并选择运行时环境,现在您将看到一个新窗口,在右上角您将看到一个选项:下载其他服务器适配器,单击并安装glassfish 服务器。

回答by user4530877

I could fix it using below steps.(GlassFish server3.1.2.2 and eclipse Luna 4.4.1)

我可以使用以下步骤修复它。(GlassFish server3.1.2.2 和 eclipse Luna 4.4.1)

  1. Help > Eclipse Marketplace > Search GlassFish > you will see GlassFish Tools > Select appropriate one and install it.
  2. Restart eclipse
  3. Windows > Open Views > Other > Server > Servers > GlassFish 3.1
  4. You will need jdk1.7.0 added to Installed JRE. Close the previous window to take effect of new default jdk1.7.0.
  1. 帮助 > Eclipse Marketplace > 搜索 GlassFish > 您将看到 GlassFish Tools > 选择合适的工具并安装它。
  2. 重启日食
  3. Windows > 打开视图 > 其他 > 服务器 > 服务器 > GlassFish 3.1
  4. 您需要将 jdk1.7.0 添加到已安装的 JRE。关闭上一窗口,新默认jdk1.7.0生效。

回答by Tulip Agarwal

To use Glassfish tools with Eclipse Luna you need Java 8. I also faced this problem because I had Java 7. If you have Java 7 in your environment then download eclipse Kepler. It will work fine.

要在 Eclipse Luna 中使用 Glassfish 工具,您需要Java 8。我也遇到了这个问题,因为我有 Java 7。如果你的环境中有 Java 7,那么下载 eclipse Kepler。它会正常工作。

回答by Harshit

I had the same issue. Not able to install neither using Marketplacenor Servers tab.

我遇到过同样的问题。无法使用MarketplaceServers 选项卡进行安装。

Following is the alternative.

以下是替代方案。

1) Help -> Install New Software

1) 帮助 -> 安装新软件

2) Use url : http://download.oracle.com/otn_software/oepe/12.1.3.6/luna/repositoryAbove is the OEPE tool provided by oracle for EE development.

2)使用url:http: //download.oracle.com/otn_software/oepe/12.1.3.6/luna/repository以上是oracle提供的EE开发的OEPE工具。

3) From all the suggestions, select glassfish tools.

3) 从所有建议中,选择 glassfish 工具。

4) Install it.

4) 安装它。

5) Restart eclipse.

5)重新启动日食。

Eclipse 4.4.2 Luna JDK : 1.8

Eclipse 4.4.2 Luna JDK:1.8

回答by hariprasad

For Eclipse Mars use the similar approach as harshit.

对于 Eclipse Mars,使用与 harshit 类似的方法。

1) Help -> Install New Software
2) Use url: http://download.oracle.com/otn_software/oepe/marsrepository Above is the OEPE tool provided by oracle for EE development.
3) From all the suggestions, select Glassfish Tools, (Oracle Weblogic Server Tools, Oracle Weblogic Scripting Tools, Oracle patches, Oracle Maven Tools).
4) Install it.
5) Restart eclipse

1) Help -> Install New Software
2) 使用网址:http: //download.oracle.com/otn_software/oepe/marsrepository 以上是oracle提供的EE开发的OEPE工具。
3) 从所有建议中,选择 Glassfish 工具,(Oracle Weblogic 服务器工具、Oracle Weblogic 脚本工具、Oracle 补丁、Oracle Maven 工具)。
4) 安装它。
5)重启eclipse

In point 3) are 4 tools are in braces, I don't know minimal combination, but only install Glassfish Tools has no effect.

在第 3) 点中,有 4 个工具在大括号中,我不知道最小组合,但仅安装 Glassfish 工具没有效果。

During restart Oepe ask for Java 8 JDK if Eclipse run on on older version.

如果 Eclipse 在旧版本上运行,则在重新启动 Oepe 期间要求 Java 8 JDK。

Eclipse 4.5.0 Mars JDK : 1.8

Eclipse 4.5.0 火星 JDK:1.8

回答by suketup

For Eclipse Luna

对于 Eclipse Luna

Go to Help>Eclipse MarketPlace> Search for GlassFish Tools and install it.

转至 Help>Eclipse MarketPlace> 搜索 GlassFish Tools 并安装它。

Restart Eclipse.

重新启动 Eclipse。

Now go to servers>new>server and you will find Glassfish server.

现在转到servers>new>server,您将找到Glassfish 服务器。

回答by Levent Divilioglu

This questions seems a little bit outdated but here is my solution.

这个问题似乎有点过时,但这是我的解决方案。

I assume that you have already downloaded GlassFish on your hard drive and unzipped the files on a directory.

我假设您已经在硬盘驱动器上下载了 GlassFish 并将文件解压缩到一个目录中。

A - Eclipse MarketPlace / Installing GlassFish Tools

A - Eclipse MarketPlace / 安装 GlassFish 工具

The first thing as it is said on previous answers, you have to downloaded GlassFish Toolsfrom eclipse marketplace;

正如在之前的答案中所说的第一件事,您必须从eclipse 市场下载GlassFish 工具

Help -> EclipseMarket Place

帮助 -> EclipseMarket Place

enter image description here

在此处输入图片说明

And install GlassFish on the screen below;

并在下面的屏幕上安装 GlassFish;

enter image description here

在此处输入图片说明

B - Adding GlassFish Server

B - 添加 GlassFish 服务器

Open Server View, if it is not visible on the bottom of the eclipse, then;

打开Server View,如果eclipse底部看不到,那么;

Window -> Show View -> Servers

窗口 -> 显示视图 -> 服务器

enter image description here

在此处输入图片说明

As the server view is visible, simply click "No servers are available. Click this link to create a new server..." as shown below;

当服务器视图可见时,只需单击“没有可用的服务器。单击此链接以创建新服务器...”,如下所示;

enter image description here

在此处输入图片说明

C - Adding GlassFish Server

C - 添加 GlassFish 服务器

On the New Serverwindow, select GlassFishas shown below. On my experience, there is only one GlassFish optionthat I can select, instead of several GlassFish options with versions as you can see down below;

New Server窗口中,选择GlassFish,如下所示。根据我的经验,我只能选择一个 GlassFish 选项,而不是您可以在下面看到的多个版本的 GlassFish 选项;

enter image description here

在此处输入图片说明

D - Configuring GlassFish & Java Locations

D - 配置 GlassFish 和 Java 位置

Enter the exact GlassFish location and also Java location as you can see below;

输入确切的 GlassFish 位置和 Java 位置,如下所示;

enter image description here

在此处输入图片说明

E - Last Step

E - 最后一步

On the last step of this configuration, just leave everything as it is. For simplicity, I don't define an admin password;

在此配置的最后一步,只需保持原样即可。为简单起见,我没有定义管理员密码;

enter image description here

在此处输入图片说明

Now everything is all set, hope that this helps!

现在一切都设置好了,希望这会有所帮助!