eclipse IntelliJ IDEA“自动制作项目”问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14635602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:54:58  来源:igfitidea点击:

IntelliJ IDEA "Make project automatically" woes

javaeclipseintellij-ideajrebel

提问by Marcel Overdijk

Back in December I switched from Eclipse to IntelliJ IDEA but within a couple of days I switched back. Today I tried IntelliJ again and basically I have only one issue left.

早在 12 月,我就从 Eclipse 切换到 IntelliJ IDEA,但几天后我又切换回来了。今天我再次尝试了 IntelliJ,基本上我只剩下一个问题了。

The issue is I want to compile Java classes on saving. The reason is I'm using JRebel which will pick up the new class. I don't want to hit ?+F9every time to compile the changed class.

问题是我想在保存时编译 Java 类。原因是我正在使用 JRebel 它将拿起新的类。我不想每次都点击?+F9来编译更改后的类。

I read about the EclipseModel plugin but this does not seem to work (anymore) as can be read in the comments on the plugin's page: http://plugins.jetbrains.com/plugin/?id=3822

我阅读了 EclipseModel 插件,但这似乎不起作用(不再),可以在插件页面的评论中阅读:http: //plugins.jetbrains.com/plugin/?id=3822

I also tried the "Make project automatically" but this compiles ALL classes and not only the changed class. This is only not more time consuming it will also cause JRebel to reload all classes.

我还尝试了“自动生成项目”,但这会编译所有类,而不仅仅是已更改的类。这不仅不会更耗时,还会导致 JRebel 重新加载所有类。

Any suggestions?

有什么建议?

采纳答案by Marcel Overdijk

I ended up creating a Macro which does the Save and the Make Build. I then assigned the Ctrl+S shortcut to this Macro and then it works fine.

我最终创建了一个执行 Save 和 Make Build 的宏。然后我将 Ctrl+S 快捷方式分配给这个宏,然后它就可以正常工作了。

回答by Anton Arhipov

What if you just remap the keys from Ctrl+F9to Ctrl+S? Basically you will just keep up with the habit of pressing Ctrl+Ssince you do that in Eclipse - just a matter of pressing a different key in IntelliJ.

如果您只是将键从Ctrl+重新映射F9Ctrl+ 会S怎样?基本上,您将保持按Ctrl+的习惯,S因为您在 Eclipse 中这样做了 - 只需在 IntelliJ 中按不同的键即可。

IntelliJ IDEA 12 indeed comes with out-of-process compiler which compiles the project classes automatically, but it seems to be unpredictable - you might refresh the page and the class is not yet compiled. So in the scenario with JRebel the off-process compilation is no use, unfortunately.

IntelliJ IDEA 12 确实带有进程外编译器,它会自动编译项目类,但它似乎是不可预测的 - 您可能会刷新页面并且该类尚未编译。因此,不幸的是,在使用 JRebel 的情况下,进程外编译是没有用的。

回答by Roberto

This may not be exactly what you want but normally I leave auto-save on, and when I need to compile the current class I'm working on, I just do Ctrl + Shift + F9.

这可能不是您想要的,但通常我会保持自动保存,当我需要编译我正在处理的当前类时,我只是这样做 Ctrl + Shift + F9.

回答by Evan

My IntelliJ IDEA version is 2017.3.4, and I modified some values so that it compiles automatically.

我的IntelliJ IDEA版本是2017.3.4,我修改了一些值让它自动编译。

Settings

设置

Registry

登记处