简体   繁体   English

将 Tomcat 9 添加到 Eclipse

[英]Add Tomcat 9 to eclipse

I have downloaded and installed tomcat 9 to my machine, but on Eclipse > Window > Preferences > Server > Runtime Environment, after clicking on Add, I see only Tomcat 7 and Tomcat 8, but not Tomcat 9.我已经将 tomcat 9 下载并安装到我的机器上,但是在 Eclipse > Window > Preferences > Server > Runtime Environment 上,单击 Add 后,我只看到 Tomcat 7 和 Tomcat 8,但没有看到 Tomcat 9。

What I have done: 1) installed tomcat 9 to local server;我做了什么:1)将tomcat 9安装到本地服务器; 2) updated eclipse to Mars (latest as of 2015-11-25); 2) 更新到火星的日食(最新至 2015-11-25); 3) installed eclipse "JST Server Adapters" and "JST Server Adapters Extensions" 3)安装eclipse“JST Server Adapters”和“JST Server Adapters Extensions”

Note: My purpose of using tomcat 9 is it seems to be the only version that explicitly support java 8 and later, and my web app is using java 8. ( http://tomcat.apache.org/whichversion.html ) I also have tomcat 7 exist in project but I also want to keep it in the machine, not to delete it.注意:我使用 tomcat 9 的目的是它似乎是唯一明确支持 java 8 及更高版本的版本,而我的网络应用程序使用的是 java 8。( http://tomcat.apache.org/whichversion.html )我也项目中存在tomcat 7,但我也想将其保留在机器中,而不是删除它。

Please see screenshot.请看截图。

在此处输入图片说明

Please let me know about any config that I missed!请让我知道我错过的任何配置!

There are two things to note here:这里有两点需要注意:

  • Tomcat 9 is not released yet. Tomcat 9 尚未发布。 Not a final version that is.不是最终版本。 If you check the official website , you will see that the only available version is an M1 version.如果您查看官方网站,您会看到唯一可用的版本是 M1 版本。 Hence there is no support from Eclipse WTP for this early version.因此,Eclipse WTP 不支持此早期版本。 It will come soon, but not yet.它很快就会到来,但还没有。

  • Tomcat 9 is not the only version that explicitly supports Java 8. If you check this page , you will see that "Supports Java version: 8 and later" , which in this context means, that it officially support only Java 8 and above. Tomcat 9 并不是唯一明确支持 Java 8 的版本。如果您查看此页面,您将看到“支持 Java 版本:8 及更高版本” ,在此上下文中,这意味着它正式仅支持 Java 8 及更高版本。 It does not mean however this is the only one supporting Java 8. Theoretically you should be able to use any Tomcat version, in practice a Tomcat 8 will work perfectly well , since it support Java 7 and above.然而,这并不意味着这是唯一支持 Java 8 的版本。理论上您应该能够使用任何 Tomcat 版本,实际上Tomcat 8 将运行良好,因为它支持 Java 7 及更高版本。 The majority of people with a Java8 + Tomcat combination are using Tomcat 8. Tomcat 8 also has Eclipse WTP support.大多数拥有 Java8 + Tomcat 组合的人都在使用 Tomcat 8。Tomcat 8 还具有 Eclipse WTP 支持。

I was able to get the adapters for Apache 9 by installing Eclipse Java EE Developer Tools 3.9.4通过安装 Eclipse Java EE Developer Tools 3.9.4,我能够获得适用于 Apache 9 的适配器

在此处输入图片说明

Use a later version of eclipse eg Eclipse Neon.使用更高版本的 Eclipse,例如 Eclipse Neon。

It should work.它应该工作。

I tried all the above methods but still was unable to find solution for the problem then I did the following and that helped me to add Apache tomcat to my Eclipse IDE: After following Help>Eclipse Marketplace and installing Eclipse Java EE Developer Tools 3.10 still tomcat was not available so I went to Help>Eclipse Marketplace>Installed>Eclipse Java EE Developer Tools 3.10>Change I put tick on the following and then I got the Apache Tomcat finally in my Eclipse IDE:我尝试了上述所有方法,但仍然无法找到问题的解决方案,然后我执行了以下操作,这帮助我将 Apache tomcat 添加到我的 Eclipse IDE:在遵循Help>Eclipse Marketplace并安装Eclipse Java EE Developer Tools 3.10 后仍然是 tomcat不可用,所以我去帮助>Eclipse Marketplace>Installed>Eclipse Java EE Developer Tools 3.10>Change我在下面打勾,然后我终于在我的Eclipse IDE中得到了Apache Tomcat:

  • JST Server Adapters JST 服务器适配器
  • JST Server Adapters Extensions JST 服务器适配器扩展
  • JSF Tools-Tag Library Metadata(Apache Trindad) JSF 工具-标签库元数据(Apache Trindad)
  • Git Integration for Eclipse Eclipse 的 Git 集成

Use later EE version of Eclipse!使用Eclipse后来EE版本! Contains Tomcat adapters 8.5 and 9.0包含 Tomcat 适配器 8.5 和 9.0

I had same problem, but not now.我有同样的问题,但不是现在。

On my side, eclipse marketplace was stucked on previous WST server adapters.在我看来,eclipse 市场被困在以前的 WST 服务器适配器上。
I've used old update feature Windows > Install New Software我使用了旧的更新功能Windows > Install New Software

In main update site, I found Web, XML, Java EE and OSGi Enterprise Development part, where WST Adapters where ready to update ...在主要更新站点中,我找到了Web, XML, Java EE and OSGi Enterprise Development部分,其中WST Adapters准备更新...... Eclipse 更新截图 Eclipse MarketPlace often embed too much features & plugins. Eclipse MarketPlace 经常嵌入太多功能和插件。
On my own point view, easier to keep a light eclipse ;-)根据我自己的观点,更容易保持日食;-)

Tested on eclipse 2020-09在 eclipse 2020-09 上测试

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

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