简体   繁体   English

游戏框架中的类路径问题

[英]Classpath issue in play framework

I sometimes move my source files from one package to another during refactoring. 有时在重构过程中,我会将源文件从一个程序包移动到另一个程序包。 After I move them, Eclipse with play plugin cannot find the classes. 移动它们之后,带有play插件的Eclipse无法找到这些类。 I have to manually fix each and every import statement, instead of letting eclipse take care of it for me. 我必须手动修复每个导入语句,而不是让Eclipse为我处理。 For a large project, this takes a lot of time . 对于大型项目,这需要很多时间

Also, each time I add a jar file to /lib Eclipse cannot find it even though it is added to the classpath. 另外,每次将jar文件添加到/lib ,即使将Eclipse文件添加到类路径中,Eclipse都找不到它。

The only solution I found is to delete the whole project, exit eclipse, "re-eclipsify" the play project, restart eclipse and reimport the project. 我发现的唯一解决方案是删除整个项目,退出eclipse,“重新eclipsify”播放项目,重新启动eclipse并重新导入该项目。 After that it works again until I need to move some files around or add jars. 之后,它将再次起作用,直到我需要移动一些文件或添加jar为止。

Is there a way to fix this classpath issue in Eclipse with Play? 有没有办法用Play修复Eclipse中的类路径问题? Regularly going through this whole re-eclipsification process is not very convenient. 定期进行整个重新选选过程不是很方便。

Edit: also have the same problem with constant variables. 编辑:常量变量也有同样的问题。 Eclipse or play caches them and it's impossible to change them unless a whole re-eclipsification takes places. Eclipse或play会缓存它们,除非进行彻底的重新选举,否则无法更改它们。

You can always add jars manually to the eclipse-projekt. 您始终可以手动将罐子添加到eclipse-projekt。 You don't need to use play eclipsify. 您不需要使用play eclipsify。

If you move classes with the refactor functionality from eclipse, eclipse adjust all Java-Sources. 如果您从eclipse中移动具有重构功能的类,则eclipse会调整所有Java源。 In routes.conf and in the views it's a manual job, except you let eclipse search for text in this files. 在routes.conf和视图中,这是手动工作,除了让eclipse在此文件中搜索文本。

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

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