java - 如何设置 IntelliJ IDEA 以重新部署已更改的资源?

标签 java intellij-idea

我使用 IntelliJ IDEA 并希望在我进行更改后重新部署我的类。 Eclipse 可以做到这一点。这在 IDEA 中如何工作?

我知道在运行配置中有“On frame deactivation”,我将其设置为“Update classes and resources”,但这不起作用。

每次在类中进行更改时,您是否都点击“重新部署”按钮?

最佳答案

在任何 Java 项目中,类重载都有限制。它还取决于您使用什么来执行此重新加载(如果您使用的是 servlet 容器等)。

默认情况下,IntelliJ 使用 HotSwap 进行重新加载。但是它有一些限制:

At the moment due to original limitations of Java SDK the HotSwapping is possible ONLY if a method body is altered. In all other cases (like changing method or class signature), the class reload is impossible and the corresponding error message appears.

就是说,配置您的应用程序以重新加载的说明 can be found here .

To configure reloading behavior

  1. On the main menu, choose File | Settings , and then expand the Debugger node.

  2. Open HotSwap page.

  3. Click one of the radio buttons in the group Reload classes after compilation. You can opt to always reload classes, reload after confirmation, or never do it.

关于java - 如何设置 IntelliJ IDEA 以重新部署已更改的资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32037537/

相关文章:

java - 从 SonarLint 中排除包根?

Android Studio/Intellij 新建项目向导

java - 获取 StringArray 项目名称

java - Gradle IDEA 项目语言级别问题

java - 创建具有唯一id的多个线程(线程不重叠)

java - 如何在 Android Studio 中更新 Cordova 版本

intellij-idea - Intellij IDEA : can I configure code style to put dot operator on previous line?

linux - 为什么 AUR Web 和部署选项看起来不同?

java - LibGDX Scene2D 对多点触控的表现很奇怪

java - Spring 框架和 RestTemplate : not being able to consume REST Service