简体   繁体   English

为什么Eclipse不断在我的工作区中重建项目?

[英]Why is Eclipse constantly rebuilding the project in my workspace?

We are using JRebel to quickly reload Java code changes into our JVM. 我们正在使用JRebel快速将Java代码更改重新加载到我们的JVM中。 This is working great! 这很棒!

But, we are also using Eclipse as IDE. 但是,我们也使用Eclipse作为IDE。 And for some reason, Eclipse can really rebuild the whole project in my workspace, just because I add an annotation, I remove a method, or any other little code change ... Because of this rebuild phase, all classes are regenerated and are required to be reloaded by JRebel. 由于某种原因,Eclipse可以真正重建我的工作区中的整个项目,只是因为我添加了一个注释,我删除了一个方法,或者任何其他一些代码更改......由于这个重建阶段,所有类都被重新生成并且是必需的由JRebel重新加载。

Is there any way to debug why Eclipse is always rebuilding our project for even a stupid little code change? 没有办法调试为什么Eclipse总是重建我们的项目,即使是一个愚蠢的小代码更改? I'm using Eclipse Indigo. 我正在使用Eclipse Indigo。

Thanks, Jochen 谢谢,Jochen

You need to disable (or) uncheck Build Automatically . 您需要禁用(或)取消选中“ Build Automatically

Goto Project menu--->uncheck Build Automatically. 转到项目菜单--->取消选中自动构建。

NOTE: This disables Automatic build. 注意:这会禁用自动构建。 But as JesperE commented, it may impact the cause why you JRebel. 但正如JesperE评论的那样,它可能会影响你JRebel的原因。

Disabling build automatically option does not break JRebel. “自动禁用构建”选项不会破坏JRebel。 JRebel depends on the results of the compilation, so if you disable the automatic build you will have to just compile the changed classes yourself, that's it. JRebel取决于编译的结果,因此如果禁用自动构建,则必须自己编译已更改的类,就是这样。

You can try setting a VM argument -Drebel.check_class_hash=true which will check the checksum before reloading the classes. 您可以尝试设置VM参数-Drebel.check_class_hash = true ,它将在重新加载类之前检查校验和。 It may slow down the reloading time from a few milliseconds to some milliseconds extra. 它可以将重新加载时间从几毫秒减慢到几毫秒。 But it is still better than the situation when all the project classes have to be reloaded. 但它仍然比必须重新加载所有项目类的情况更好。

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

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