Eclipse 未构建项目
我正在使用 Eclipse,并将输出文件夹设置为 WebContent/WEB-INF/classes
。默认值为build/classes
。
当我尝试构建课程时,什么也没有出现。什么也没发生。
当我检查资源管理器中的目录时,会生成类文件。但它们没有在 Eclipse 中显示。
我正在使用 tomcat 来运行 Java 应用程序。我收到错误:
无法找到 java 类。
我尝试过清洁,但没有效果。
任何帮助将不胜感激。
I am using Eclipse and I've set the output folder to WebContent/WEB-INF/classes
. The default was build/classes
.
When I try to build the classes, nothing shows up. Nothing happens.
When I check the directory in the explorer, the class files are generated. But they are not shown in Eclipse.
I am using tomcat
to run the Java app. I get an error:
Unable to find java class.
I tried cleaning and it didn't work.
Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
检查项目是否正确构建。
转到项目属性,选择Java Build Path,然后选择其中的Source选项卡。
在源选项卡中,确保默认输出文件夹的路径正确。
由于项目将部署在 Tomcat 服务器中。
通过导出 WAR 文件检查类是否正确位于所需位置。
如果问题仍然存在,请关闭项目并再次打开,以便
正确加载 Eclipse 设置。
希望所有这些事情对您有所帮助。
Check that the Project is built properly.
Go to project properties ,select Java Build Path and select Source tab in that.
In Source tab make sure that the path for Default output folder is correct.
As the project will be deployed in Tomcat server .Check the classes are properly in the
required locations by exporting WAR file.
If the problem persists , close the project and open it again so that the eclipse settings
are loaded properly.
Hope all these things help you.
我遇到了同样的问题并找到了解决方案:
我的工作区中有两个项目,一个是在代码更改的基础上构建的,另一个则没有。
我的解决方案是:
当我进入项目时 ->属性->构建器中,有一个项目缺少“Java Builder”。
因此,我手动编辑了 .project 文件并添加:
重新加载项目,现在一切正常!
希望这有帮助..
I have had the same problem and found the solution:
I had two projects in my workspace, one was building on code change and one did not.
The solution for me was:
When I entered project -> properties -> builders, one project was missing the 'Java Builder'.
So I have manually edited the .project file and added:
Reload the project and now all is working well!
Hope this help..
进入“java Build path”并检查“Libraries”选项卡。是否有任何 jar 文件显示错误符号(jar 文件路径丢失),然后删除该 jar 并再次添加。这是 eclipse 不构建类文件的原因之一。
Go in "java Build path" and check Libraries Tab. is there any jar file showing error symbol(jar file path is missing) then delete that jar and add again. this is one of the reason if eclipse is not building class file.
像 Package Explorer 和 Project Explorer 这样的视图会过滤掉编译器输出目录,因为它们大多数时候只是噪音。如果您需要完全按照文件系统上的方式浏览项目目录,则应打开导航器视图。
Tomcat 的问题无关。
Views like Package Explorer and Project Explorer, filter out compiler output directories as they are just noise most of the time. If you need to browse the project directory exactly as it is on the file system, you should open the Navigator view.
The issue with Tomcat is unrelated.
转到查看菜单(在项目资源管理器右上角)---->自定义视图---->取消选中“java 输出文件夹”。
Go to View menu (in project explorer right top corner) ----> Customize veiw ----> Uncheck "java output folder".
我遇到了这个问题,这就是我所做的:
希望这对某人有帮助!
I had this issue and here is what I did:
Hope this helps someone!