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

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

问题描述

昨天我从 Eclipse 切换到 IntelliJ IDEA.

Yesterday I switched to IntelliJ IDEA from Eclipse.

我也在 WebSphere Server 7 中使用 JRebel.

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.

Eclipse自动构建"功能解决了这个问题.

The Eclipse "Build Automatically" feature resolved this issue.

在 IntelliJ IDEA 中,我必须按 CTRL+SHIFT+9 重新编译相关类,以便 JRebel 将其拾取.如果更改跨两个文件,我必须对每个文件和其中一个文件执行此操作,并且由于 IntelliJ 使用全部保存机制,因此很难知道要重新编译什么手动,我也不是很感兴趣.

In IntelliJ IDEA, 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?

推荐答案

UPDATED

对于 IntelliJ IDEA 12+ 版本,如果我们使用外部编译器选项,我们可以自动构建编辑过的源代码.唯一需要的是检查选项自动构建项目",位于编译器"设置下:

此外,如果您想在应用程序运行时进行热部署,或者如果您正在使用 spring boot devtools,您应该从注册表启用 compiler.automake.allow.when.app.running也.这将自动编译您的更改.

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 上))在注册表窗口打开后输入 Registry,找到并启用 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 自动编译保存的文件.


For versions older than 12, you can use the EclipseMode plugin to make IDEA automatically compile the saved files.

有关更多提示,请参阅"迁移自Eclipse 到 IntelliJ IDEA" 指南.

For more tips see the "Migrating From Eclipse to IntelliJ IDEA" guide.

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

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