Intellij IDEA Java类不会在保存时自动编译 [英] Intellij IDEA Java classes not auto compiling on save

查看:4121
本文介绍了Intellij IDEA Java类不会在保存时自动编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我从Eclipse切换到了Intellij。

Yesterday I switched to Intellij from Eclipse.

我也在使用jRebel和Websphere Server 7.

I am using jRebel with Websphere Server 7 as well.

现在一切似乎都运行得有点好,除了当我修改一个Java文件,点击保存,Intellij 重新编译该文件,以便jRebel选择它向上。

Everything now seems to be working somewhat fine, except that when I modify a Java file, and hit save, Intellij does not re-compile the file, in order for jRebel to pick it up.

日食自动构建功能解决了这个问题。

The eclipse "Build Automatically" feature resolved this issue.

在Intellij中,我必须按 CTRL + SHIFT + 9 重新编译jRebel的相关类才能获取它。如果在两个文件之间进行了更改,我有在每个文件上执行此操作,并且由于Intellij使用了save all机制,因此很难知道要重新编译的内容手动,我真的不感兴趣。

In Intellij, I have to hit CTRL + SHIFT + 9 to re-compile the relevant class for jRebel to pick it up. If changes are done across two files, I have to do this on each and one of them and since Intellij uses the save all mechanism, its pretty hard to know what to recompile manually which I am not really interested in doing either.

有没有办法让Intellij 自己做

Isn't there a way to make Intellij to do this on its own?

推荐答案

更新

对于IDEA 12+版本,我们可以自动构建已编辑的来源,如果我们使用外部编译器选项。唯一需要的是检查编译器设置下的自动构建项目选项。

此外,如果您希望热部署,在应用程序运行时或者如果您使用的是Spring boot devtools,则应启用 compile.automake.allow.when.app.running 来自注册表。这将自动编译您的更改。

UPDATED
For IDEA 12+ releases we can build automatically the edited sources if we are using the external compiler option. The only thing needed is to check the option "Build project automatically", located under Compiler Settings. Also, if you would like to hot deploy, while the application is running or if you are using spring boot devtools you should enable the compiler.automake.allow.when.app.running from registry too. This will automatically compile your changes.

使用 ctrl + shift + A (或 + shift + A 在mac上)类型注册表一旦注册表窗口打开,找到并启用 compiler.automake.allow.when.app.running ,请看这里:

Using ctrl+shift+A (or +shift+A on mac) type Registry once the registry windows is open, locate and enable compiler.automake.allow.when.app.running, see here:



对于12以上的版本,您可以使用EclipseMode插件使IDEA自动编译保存的文件。请参阅: https://www.jetbrains.com/help/idea/2016.3/eclipse .html 了解从Eclipse迁移时的更多提示。


For versions older than 12, you can use the EclipseMode plugin to make IDEA automatically compile the saved files. See: https://www.jetbrains.com/help/idea/2016.3/eclipse.html for more tips when migrating from Eclipse.

这篇关于Intellij IDEA Java类不会在保存时自动编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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