简体   繁体   English

从Eclipse中的项目中删除Apache TomCat运行时?

[英]Removing the Apache TomCat runtime from a project in Eclipse?

I've got a project I've been building on Eclipse Ganymede targetted at tomcat 6.0, I've imported it into Europa and I need it to run on apache Tomcat 5.5 我有一个项目,我一直在Eclipse Ganymede上构建,目标是tomcat 6.0,我已将它导入Europa,我需要它在apache Tomcat 5.5上运行

I can't find the reference to where the runtime is set to 6.0 to remove it. 我找不到运行时设置为6.0的位置的引用来删除它。 I've tried going to Windows > preferences > Server and I've installed the 5.5 runtime. 我试过去Windows> preferences> Server,我已经安装了5.5运行时。

I can't however seem to find where the reference is to runtime 6.0 to remove it. 但是我似乎无法找到引用6.0的引用去除它。

Any help would be appreciated. 任何帮助,将不胜感激。

Update: 更新:

I cant find any reference to Tomcat v6.0 in my build path, there is a reference to the servlet-api.jar of tomcat 5.5 though... 我无法在我的构建路径中找到对Tomcat v6.0的任何引用,但是有一个对tomcat 5.5的servlet-api.jar的引用虽然...

When Eclipse is up and running, choose preferences from the window menu. 当Eclipse启动并运行时,从窗口菜单中选择首选项。 Choose from the bar on the left: Server, Runtime Environments. 从左侧的栏中选择:服务器,运行时环境。

Click the button Add, choose the version you want. 单击“添加”按钮,选择所需的版本。

To remove the 6.0 reference, goto the libraries tab. 要删除6.0引用,请转到库选项卡。

You can delete a Runtime easily from here, with no mess up: 您可以从这里轻松删除运行时,不会搞砸:

Windows->Preferences->Server->Runtime Enviroments Windows-> Preferences-> Server-> Runtime Enviroments

I had a similar problem. 我遇到了类似的问题。 I had a prject referring to a no more existing Tomcat instance. 我有一个prject引用了一个不再存在的Tomcat实例。 I was not able to remove Tomcat from "Server" and "Runtime Environments" from UI (delete button always gray),so I solved the problem deleting all the reference from the filesystem: 我无法从UI中删除“服务器”和“运行时环境”中的Tomcat(删除按钮始终为灰色),因此我解决了从文件系统中删除所有引用的问题:

In project folder check files: 在项目文件夹检查文件中:

  • .classpath 的.classpath
  • .settings/org.eclipse.wst.common.project.facet.core.xml .settings / org.eclipse.wst.common.project.facet.core.xml的

In workspace folder check: 在工作区文件夹中检查

  • .metadata.plugins\\org.eclipse.debug.core .metadata.plugins \\ org.eclipse.debug.core
  • .metadata.plugins\\org.eclipse.wst.server.core .metadata.plugins \\ org.eclipse.wst.server.core
  • .metadata.plugins\\org.eclipse.core.runtime.settings\\org.eclipse.jst.server.tomcat.core.prefs .metadata.plugins \\ org.eclipse.core.runtime.settings \\ org.eclipse.jst.server.tomcat.core.prefs

Maybe a bit brutal but I didn't find a better solution. 也许有点残酷,但我找不到更好的解决方案。

This was tested over Eclipse Luna 4.4.2 这是在Eclipse Luna 4.4.2上测试的

In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings. 在{workspace-directory} /。metadata / .plugins / org.eclipse.core.runtime / .settings中。 delete the following two files: 删除以下两个文件:

  • org.eclipse.wst.server.core.prefs org.eclipse.wst.server.core.prefs
  • org.eclipse.jst.server.tomcat.core.prefs org.eclipse.jst.server.tomcat.core.prefs

Restart Eclipse 重启Eclipse

First, open the eclipse preferences, 首先,打开eclipse首选项,

日食偏好

then find the sever runtime environments, 然后找到服务器运行时环境,

eclipse服务器运行时环境

you can now delete as you wish. 您现在可以根据需要删除。

卸载项目并重新加载修复它...我喜欢Eclipse的人...

Delete the old server and add a new server. 删除旧服务器并添加新服务器。 I had the same problem due to the fact that i changed the runtime environment to Java EE (for a webservice) and later had problems running my local apps. 我遇到了同样的问题,因为我将运行时环境更改为Java EE(用于Web服务),后来运行本地应用程序时出现问题。 All i did was to delete and create a new server instance with apache runtime. 我所做的就是删除并使用apache运行时创建一个新的服务器实例。

after removing the installed runtime from eclipse, do the following: 从eclipse中删除已安装的运行时后,请执行以下操作:

1] Close Eclipse

2] In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings. delete the following two files:
    org.eclipse.wst.server.core.prefs
    org.eclipse.jst.server.tomcat.core.prefs

3] Restart Eclipse

ref: http://crunchify.com/eclipse-how-to-fix-installing-apache-tomcat-server-issue-blank-server-name-field/ 参考: http//crunchify.com/eclipse-how-to-fix-installing-apache-tomcat-server-issue-blank-server-name-field/

Yep, I have eclipse Version: Indigo Service Release 2; 是的,我有eclipse版本:Indigo Service Release 2; Build id: 20120216-1857, unfortunately deleting the workspace solve the problem with having old Target Runtime. 构建ID:20120216-1857,遗憾的是删除工作区解决了旧目标运行时的问题。 Don't forget to copy all your project work if there is no source control ;) .... 如果没有源代码控制,请不要忘记复制所有项目工作;)....

Open the Build Path and go to the Libraries tab. 打开Build Path并转到Libraries选项卡。 Remove the Apache Tomcat 6.0 library and add 5.5. 删除Apache Tomcat 6.0库并添加5.5。 This is the library that your project uses to build it self. 这是您的项目用于自己构建它的库。

You can add new runtimes for running your project in the Servers view (Right-Click, Add new Server) 您可以在Servers视图中添加用于运行项目的新运行时(右键单击,添加新服务器)

您也可以为此定义一个新服务器,并在那里指定它,也可以通过双击它来更改服务器配置,您将看到带有它的属性的窗口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM