Java 将 Tomcat 9 添加到 Eclipse
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33910448/
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
Add Tomcat 9 to eclipse
提问by jamesdeath123
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; 2) updated eclipse to Mars (latest as of 2015-11-25); 3) installed eclipse "JST Server Adapters" and "JST Server Adapters Extensions"
我做了什么:1)将tomcat 9安装到本地服务器;2) 更新到火星的日食(最新至 2015-11-25);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!
请让我知道我错过的任何配置!
采纳答案by Gergely Bacso
There are two things to note here:
这里有两点需要注意:
Tomcat 9 is not released yet.Not a final version that is. If you check the official website, you will see that the only available version is an M1 version. Hence there is no support from Eclipse WTP for this early version. 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. It does notmean 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. The majority of people with a Java8 + Tomcat combination are using Tomcat 8. Tomcat 8 also has Eclipse WTP support.
Tomcat 9 尚未发布。不是最终版本。如果您查看官方网站,您会看到唯一可用的版本是M1版本。因此,Eclipse WTP 不支持此早期版本。它很快就会到来,但还没有。
Tomcat 9 并不是唯一明确支持 Java 8 的版本。如果您查看此页面,您将看到“支持 Java 版本:8 及更高版本”,在此上下文中,这意味着它正式仅支持 Java 8 及更高版本。它并不意味着然而,这是唯一一个支持Java 8理论上你应该能够使用任何Tomcat的版本,在实践中的Tomcat 8将会很好地工作,因为它支持Java 7及以上。大多数拥有 Java8 + Tomcat 组合的人都在使用 Tomcat 8。Tomcat 8 还具有 Eclipse WTP 支持。
回答by Mwangi Thiga
Use a later version of eclipse e.g. Eclipse Neon.
使用更高版本的 Eclipse,例如 Eclipse Neon。
It should work.
它应该工作。
回答by va?átko
Use later EEversion of Eclipse! Contains Tomcat adapters 8.5 and 9.0
使用后EE版的Eclipse!包含 Tomcat 适配器 8.5 和 9.0
I had same problem, but not now.
我有同样的问题,但不是现在。
回答by Ares
回答by sohini chaudhuri
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 Marketplaceand installing Eclipse Java EE Developer Tools 3.10still tomcat was not available so I went to Help>Eclipse Marketplace>Installed>Eclipse Java EE Developer Tools 3.10>ChangeI 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 Server Adapters Extensions
- JSF Tools-Tag Library Metadata(Apache Trindad)
- Git Integration for Eclipse
- JST 服务器适配器
- JST 服务器适配器扩展
- JSF 工具-标签库元数据(Apache Trindad)
- Eclipse 的 Git 集成