如何防止Eclipse + Tomcat运行当前类而不是项目(Vaadin) [英] How to prevent Eclipse+Tomcat from running current class instead of project (Vaadin)

查看:94
本文介绍了如何防止Eclipse + Tomcat运行当前类而不是项目(Vaadin)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个简单的配置更改,但我似乎找不到一个明显的设置来解决以下问题:

This may well prove to be a simple config change, but I can't seem to find an obvious setting to solve the following problem:

我有一个Vaadin Eclipse中的项目,配置为使用Tomcat v6进行调试。如果我在项目浏览器中选择项目的顶部并调试,则eclipse浏览器将启动,我的Web应用程序将打开以下URL:

I have a Vaadin project in Eclipse, which is configured to be debugged with Tomcat v6. If I select the top of the project in the project explorer and hit debug, the eclipse browser launches and my web app opens with the following url:

http:// localhost:8080 / MyVaadinProject / 此工作

但是,如果我目前正在查看在一个java文件(比如说Myproject.java)中,Eclipse试图通过这个URL打开java文件:

However, if I'm currently looking at a java file (say Myproject.java), Eclipse tries to open the java file at this url:

http://localhost:8080/MyVaadinProject/WEB-INF/classes/com/example/myproject/Myproject.java 

当然,这会产生一个404。

Of course, that produces a 404.

每次我想要调试时,不得不取消选择/关闭我的java文件是相当乏味的。有没有办法防止这种行为在eclipse?

Having to deselect/close my java files every time I want to debug is quite tedious. Is there some way to prevent this behaviour in eclipse?

我在OSX Lion,Eclipse版本3.7.2。

I am on OSX Lion, Eclipse version 3.7.2.

谢谢!

推荐答案

运行项目时,而不是突出显示Project Explorer中的类文件,的项目运行前。

When running the project, instead of highlighting the class file in the Project Explorer, highlight the very base of the project before running.

这是我们想要运行的,而不是类文件本身。

This is what we want to run anyway, not the class file itself.

这篇关于如何防止Eclipse + Tomcat运行当前类而不是项目(Vaadin)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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