Eclipse 添加Tomcat 7 空白服务器名称

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14791843/
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-09-10 21:33:17  来源:igfitidea点击:

Eclipse add Tomcat 7 blank server name

eclipsejakarta-eetomcat

提问by tonga

I was trying to add Tomcat 7 in my Eclipse in Ubuntu. When I click "Add new server" in Eclipse and select "Tomcat v7.0 Server", the field "Server Name" is blank and I cannot type in anything in that textbox as shown below:

我试图在 Ubuntu 的 Eclipse 中添加 Tomcat 7。当我在 Eclipse 中单击“添加新服务器”并选择“Tomcat v7.0 服务器”时,“服务器名称”字段为空,我无法在该文本框中输入任何内容,如下所示:

Eclipse Add Tomcat Server

Eclipse 添加 Tomcat 服务器

What I did before is I deleted a Tomcat 7 server from Eclipse and I was trying to reinstall Tomcat 7. But it doesn't allow me to type anything in that textbox and I cannot proceed to the "Next" button. My environment is Ubuntu Linux and Eclipse for JavaEE.

我之前所做的是从 Eclipse 中删除了一个 Tomcat 7 服务器,我试图重新安装 Tomcat 7。但它不允许我在该文本框中输入任何内容,我无法继续“下一步”按钮。我的环境是用于 JavaEE 的 Ubuntu Linux 和 Eclipse。

回答by Philipp Cla?en

It is a bug in Eclipse. I had exactly the same problem, also on Ubuntu with Eclipse Java EE Juno.

这是 Eclipse 中的一个错误。我也遇到了完全相同的问题,也在使用 Eclipse Java EE Juno 的 Ubuntu 上。

Here is the workaround that worked for me:

这是对我有用的解决方法:

  1. Close Eclipse
  2. In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settingsdelete the following two files:
    • org.eclipse.wst.server.core.prefs
    • org.eclipse.jst.server.tomcat.core.prefs
  3. Restart Eclipse
  1. 关闭日食
  2. {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings删除以下两个文件:
    • org.eclipse.wst.server.core.prefs
    • org.eclipse.jst.server.tomcat.core.prefs
  3. 重启 Eclipse

Source: eclipse.org Forum

来源:eclipse.org 论坛

回答by Michael Brooks

I am running kepler in ubuntu and had the same problem getting eclipse to recognize the tomcat7 server. My path to install directory was fine and deleting/renaming the files only did not fix it either.

我在 ubuntu 中运行 kepler 并且在让 eclipse 识别 tomcat7 服务器时遇到了同样的问题。我的安装目录路径很好,仅删除/重命名文件也没有解决问题。

This is what worked for me:

这对我有用:

run the following in terminal:

在终端中运行以下命令:

cd ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/    
rm org.eclipse.jst.server.tomcat.core.prefs    
rm org.eclipse.wst.server.core.prefs
cd /usr/share/tomcat7
sudo service tomcat7 stop
sudo update-rc.d tomcat7 disable
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat7 log
sudo chmod -R 777 /usr/share/tomcat7/conf
sudo ln -s /var/lib/tomcat7/common common
sudo ln -s /var/lib/tomcat7/server server
sudo ln -s /var/lib/tomcat7/shared shared

restart eclipse, delete tomcat7 server. Re-add server and everything then worked.

重启eclipse,删除tomcat7服务器。重新添加服务器,然后一切正常。

Here is the link I used. http://linux.mjnet.eu/post/1319/tomcat-7-ubuntu-13-04-and-eclipse-kepler-problem-to-run/

这是我使用的链接。 http://linux.mjnet.eu/post/1319/tomcat-7-ubuntu-13-04-and-eclipse-kepler-problem-to-run/

回答by Steve Chambers

I had a similar issue except the "Server Name" field was disabled.

我有一个类似的问题,除了“服务器名称”字段被禁用

Found this was due to the Apache Tomcat v7.0 runtime environment pointing to the wrong folder. This was fixed by going to Window - Preferences - Server - Runtime Environments, clicking on the runtime environment entry and clicking "Edit..." and then modifying the Tomcat installation directory.

发现这是由于 Apache Tomcat v7.0 运行时环境指向错误的文件夹。这是通过转到窗口 - 首选项 - 服务器 - 运行时环境,单击运行时环境条目并单击“编辑...”然后修改 Tomcat 安装目录来修复的。

回答by Vinay

I had same issue before: the server name was not appearing in server while configuring with eclipse

我之前遇到过同样的问题:使用 eclipse 配置时服务器名称没有出现在服务器中

I tried all the solutions which are provided over here, but they didn't work for me.

我尝试了这里提供的所有解决方案,但它们对我不起作用。

I resolved it, by simply following these simple tips

Step1: Windows --> Preferences --> Server --> Run time Environments --> Add --> select the tomcat version which was unavailable before --> next --> browse the location of your server with same version

Step2: go to servers and select your server version --> next --> Finish

Issue resolved!!! :)

我解决了它,只需遵循这些简单的提示

Step1:Windows --> Preferences --> Server --> Run time Environments --> Add --> 选择之前不可用的tomcat版本--> next --> 浏览你的服务器所在版本的相同版本

步骤 2:转到服务器并选择您的服务器版本 --> 下一步 --> 完成

问题解决了!!!:)

回答by Tushar

I faced the same issue, and I changed the workspace to new location, and it worked. I hope this helps :)

我遇到了同样的问题,我将工作区更改为新位置,并且有效。我希望这有帮助 :)

回答by dsharew

so weird but this worked for me.

太奇怪了,但这对我有用。

  1. close eclipse

  2. start eclipse as eclipse --clean

  1. 日食

  2. 开始日食 eclipse --clean

回答by silverzhao

I also had this problem today, and deleting files org.eclipse.jst.server.tomcat.core.prefsand org.eclipse.wst.server.core.prefsdidn't work.

今天我也有这个问题,并删除文件org.eclipse.jst.server.tomcat.core.prefsorg.eclipse.wst.server.core.prefs没有工作。

Finally I found it's permission issue:

最后我发现它是权限问题:

By default <apache-tomcat-version>/conf/*can be read only by owner, after I made it readable for all, it works! So run this command:

默认情况下<apache-tomcat-version>/conf/*只能由所有者读取,在我让它对所有人可读后,它就可以工作了!所以运行这个命令:

chmod a+r <apache-tomcat-version>/conf/*

Here is the link where I found the root cause:

这是我找到根本原因的链接:

http://www.thecodingforums.com/threads/eclipse-cannot-create-tomcat-server.953960/#post-5058434

http://www.thecodingforums.com/threads/eclipse-cannot-create-tomcat-server.953960/#post-5058434

回答by School Boy

After trying @Philipp Cla?ensteps, even if did not work then,

在尝试了@Philipp Cla?en步骤之后,即使没有工作,

Change eclipse, workspace and tomcat directory.[tested only for Windows7]

更改 eclipse、workspace 和 tomcat 目录。[仅针对 Windows7 测试]

I know somebody might say that is not correct, but that did work for me after @Phillipp's steps not worked for me.

我知道有人可能会说这不正确,但是在@Phillipp 的步骤对我不起作用之后,这对我有用。

It took me 4 hours to find this brute force method solution.

我花了4个小时才找到这个蛮力方法的解决方案。

回答by Andrew

In my case, the tomcat directory was owned by root, and I was not running eclipse as root.

就我而言,tomcat 目录归 root 所有,我没有以 root 身份运行 eclipse。

So I had to

所以我不得不

sudo chown -R  $USER apache-tomcat-VERSION/

回答by blueray

The easiest solution is to create a new workspace in eclipse/STS.

最简单的解决方案是在 eclipse/STS 中创建一个新的工作区。

File -> Switch Workspace -> Others...