如何在 Eclipse 中使用 Tomcat 8? [英] How to use Tomcat 8 in Eclipse?

查看:41
本文介绍了如何在 Eclipse 中使用 Tomcat 8?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑 2014-02-07:Eclipse Luna 在这里,捆绑的 WTP 中包含对 Tomcat 8 的支持:) 快乐的日子!

Tomcat 8 仍在开发中,但您可以获取它这里.现在主 Apache Tomcat 页面上有一个 RC 版本.2014 年 2 月 27 日更新:8 现已发布,为 WTP 构建的适配器尚未集成到 eclipse 包中.很快!

Tomcat 8 is still in development, but you can get it here. Now there is a RC version on the main Apache Tomcat page. Update 2/27/14: 8 is released now, and adapters built for WTP, just not integrated into eclipse bundles yet. Soon!

不过,在 Eclipse Kepler 中,Tomcat 8 的添加服务器列表中没有支持的适配器.Tomcat 7 适配器​​不起作用,而且看起来在安装新扩展"对话框.

In Eclipse Kepler though, there is no supported adapter in the add server list for Tomcat 8. the Tomcat 7 adapter doesn't work, and it doesn't look like there's a new extension for it to download in the "Install new Extension" dialog.

我唯一的选择是让它 (Tomcat 8) 在 Eclipse 之外本地运行,并且可能将远程调试器挂在它上面以单步调试代码吗?这甚至适用于 Eclipse Kepler + Tomcat 8 吗?IntelliJ IDEA 12 在我投入的 30 分钟内无法做到.

Is my only option to get it (Tomcat 8) running locally outside of Eclipse and maybe hook a remote debugger into it for stepping through code? Will that even work for Eclipse Kepler + Tomcat 8? IntelliJ IDEA 12 couldn't do it in the 30 minutes of time I put into that path.

如果你想知道我为什么要这样做,我正在玩 Spring 4.0.0.M1 和 4.0.0.M2 WebSocket 的东西.他们(根据 Rossen Stoyanchev 的 Spring 4.0 博客文章和示例)使用 JSR-356,它在 Tomcat 8 中实现,理论上会在某个时候向后移植到 Tomcat 7.

If you're wondering why I'm trying to do this at all, I'm playing around with Spring 4.0.0.M1 and 4.0.0.M2 WebSocket stuff. They (per Rossen Stoyanchev's Spring 4.0 blog post and examples) use JSR-356, which is implemented in Tomcat 8, theoretically to be back-ported at some point to Tomcat 7.

回答更广泛的问题我怎样才能轻松获得支持 Spring 4 WebSocket 的开发环境?"会很好,但知道如何将不受支持的 Web 服务器插入 Eclipse 也会很好.

An answer to the broader question of "How can I easily get a development environment going for Spring 4 WebSocket support?" would be nice, but it would also still be nice to know how to plug in unsupported web servers to Eclipse.

干杯,E

**更新 8/7/13 - Rossen Stoyanchev 更新了 Spring 4.0.0.M2 博客 并添加了一些 jpda 智慧并分享了是的,他正在使用远程调试:

**Update 8/7/13 - Rossen Stoyanchev updated the Spring 4.0.0.M2 blog and added some jpda wisdom and shared that yeah, he's using remote debugging:

也就是说,在 Eclipse 中使用 Tomcat 8 进行调试并不难.只需将 bin/startup.sh 中的最后一行更改为(注意添加了jpda"):

That said, it's not very hard to debug with Tomcat 8 inside Eclipse. Just change the last line in bin/startup.sh to be (note the addition of "jpda"):

 exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"

在Eclipse里面创建localhost 80端口的远程调试配置,启动Tomcat后启动,可以在源码中设置断点.

Inside Eclipse create a remote debugging configuration for localhost port 80, launch it after starting Tomcat, and you can put breakpoints in the source code.

谢谢罗森!

** 2013 年 9 月 29 日更新 - Eclipse Kepler SR1 刚刚到货,可惜!Tomcat 8 不支持 WTP.Tomcat 8 最高可达 RC3.

**Update 9/29/13 - Eclipse Kepler SR1 just arrived, but alas! No WTP support for Tomcat 8. Tomcat 8 is up to RC3.

**更新 12/5/13

**Updates 12/5/13

  • 博客网址修复.
  • Tomcat 8 到 RC5.
  • 在 Eclipse 中跟踪 WTP 修复以支持 Tomcat 8 的错误此处.
  • IntelliJ IDEA 新版本 13 表示它现在支持 Tomcat 8.还没有亲自尝试过.

推荐答案

UPDATE:Eclipse Mars EE 和更高版本对 Tomcat8 有本机支持.仅当您拥有较早版本的 eclipse 时才使用此选项.

UPDATE: Eclipse Mars EE and later have native support for Tomcat8. Use this only if you have an earlier version of eclipse.

最新版本的 Eclipse 仍然不支持 Tomcat 8,但您可以添加新版本的 WTP 和 Tomcat 8 支持将被原生添加.为此:

The latest version of Eclipse still does not support Tomcat 8, but you can add the new version of WTP and Tomcat 8 support will be added natively. To do this:

  • Download the latest version of Eclipse for Java EE
  • Go to the WTP downloads page, select the latest version (currently 3.6), and download the zip (under Traditional Zip Files...Web App Developers). Here's the current link.
  • Copy the all of the files in features and plugins directories of the downloaded WTP into the corresponding Eclipse directories in your Eclipse folder (overwriting the existing files).

启动 Eclipse,在部署时应该有一个 Tomcat 8 选项可用.

Start Eclipse and you should have a Tomcat 8 option available when you go to deploy.

这篇关于如何在 Eclipse 中使用 Tomcat 8?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆