昨天我从Eclipse切换到IntelliJ IDEA。

我也在WebSphere Server 7中使用JRebel。

现在一切似乎都运行得很好,除了当我修改一个Java文件并点击保存时,IntelliJ不会重新编译文件,以便JRebel拾取它。

Eclipse的“自动构建”特性解决了这个问题。

在IntelliJ IDEA中,我必须按CTRL+SHIFT+9来重新编译JRebel的相关类。如果跨两个文件进行更改,我必须在每个文件上都这样做,因为IntelliJ使用了保存所有机制,很难知道手动重新编译什么,我也不感兴趣。

难道没有办法让IntelliJ自己来做这个吗?


当前回答

我有同样的问题,也有一个问题文件图标在intellij,所以我删除了。idea文件夹和重新导入项目解决了我的问题。

其他回答

您可以按ctrl+s键映射保存和编译在一个步骤。转到键映射设置并搜索Compile。

警告

Eclipse模式插件已经过时,并且与最近的IDEA 12+版本不兼容。如果你安装它,IDE将挂起每一个文件更改,并将响应极慢。


IntelliJ IDEA不使用自动构建,它在运行中检测错误,而不是通过编译器。类似于Eclipse模式将在IDEA 12中可用:

使用Build | Make,它调用增量的Make过程,只编译更改的和依赖的文件(它非常快)。

还有一个常见问题解答条目可能会有所帮助。

Update on the automatic make feature: When run/debug configuration is running, Make project automatically has no effect. Classes on disk will change only on Build | Make. It's the core design decision as in our opinion class changes on disk should be always under user's control. Automatic make is not the copycat of Eclipse feature, it works differently and it's main purpose is to save time waiting for the classes to be ready when they are really needed (before running the app or tests). Automatic make doesn't replace the explicit compilation that you still need to trigger like in the case described in this question. If you are looking for different behavior, EclipseMode plug-in linked in the FAQ above would be a better choice.

对于Intellij 2021或更高版本,您将找不到注册表项

compiler.automake.allow.when.app.running

它已经移动到高级设置如下面的截图所示

来源:https://youtrack.jetbrains.com/issue/idea - 274903

我得到错误:一些罐子不在类路径。因此,我只是删除损坏的jar并执行以下步骤

1.Project >  Setting>Build,Execution,Deployment>Compiler>check build project automatically
2.CTRL+SHIFT+A find/search **registry** --Check for below param
compiler.automake.allow.when.app.running
compiler.automake.trigger.delay=500---According to ur requirement
3.Add devtool in pom.xml
         <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
4.Build ,If found any probelm while building ,saying some jar in not in class path.Just delete the corrupted jar
and re-build the project angain after sync with maven lib

请仔细执行以下步骤来启用它。

1)使用SB V1.3创建Spring Boot项目,并将“Devtools”(1*)添加到依赖项中

2)调用Help->查找动作…输入“Registry”,在对话框中搜索“automake”,并启用“compiler. autommake .allow.when.app.running”条目,关闭对话框

3)在设置->构建,执行,部署->编译器“自动制作项目”中启用后台编译

4)打开Spring Boot运行配置,如果一切配置正确,你应该得到警告信息

5)运行应用程序,实时更改课程

请将您的经验和问题以评论的形式报告给我们。

点击这里了解更多信息