IntelliJ IDEA“自动构建项目"显然不起作用 [英] IntelliJ IDEA "Build project automatically" apparently not working

查看:309
本文介绍了IntelliJ IDEA“自动构建项目"显然不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java的Eclipse长期用户,并且习惯于在引起问题后立即在问题"视图中看到编译错误和警告.

I am a long-time Eclipse user for Java and I am used to seeing compilation errors and warnings in the "Problems" view as soon as I cause them.

现在,我正在使用IntelliJ IDEA(科特林和Java).有一个问题"视图,但是即使我的代码窗口的边缘显示错误或警告,它也经常保持空白.

Now I am using IntelliJ IDEA (Kotlin and Java). There is a "Problems" view, but it often stays empty even if there are errors or warnings showing on the margin of my code window.

如果我按Ctrl-F9选择"Build Project",则错误是警告在问题"上列出,但我希望这种情况会自动发生.

The errors are warnings are listed on "Problems" if I pressed Ctrl-F9 for "Build Project" but I would like that to happen automatically.

我选择了设置"->构建,执行,部署"->编译器"->自动构建项目",但这似乎没有什么作用.

I've selected "Settings" -> "Build, Execution, Deployment" -> "Compiler" -> "Build project automatically", but that does not seem to make a difference.

StackOverflow显示在保存时不会自动编译的Intellij IDEA Java类作为可能的相关问题,但选择的答案对我不起作用.除了很老之外,该回答还说仅当您使用外部编译器选项时,自动构建项目"才有效",但我不知道那是什么(在IntelliJ文档中搜索外部编译器"不会返回任何相关的内容),而我的设置没有提及.而且答案仍然没有说明如果您仍然不使用该选项怎么办.

StackOverflow shows Intellij IDEA Java classes not auto compiling on save as a possible related question, but the chosen answer doesn't work for me. Besides being quite old, that answer says that "Build Project Automatically" only works "if you are using the external compiler option", but I don't know what that is (a search for "external compiler" on IntelliJ's documentation does not return anything relevant) and my settings don't mention it. And the answer does not say what to do if you are not using such option anyway.

那么,当我在IntelliJ IDEA中修改代码时,如何查看自动列出的错误和警告?

So, how can I see errors and warnings listed automatically as I modify the code in IntelliJ IDEA?

推荐答案

自动构建项目仅在不运行/调试时有效,如旁边的设置所示.

Build project automatically is only works while not running / debugging as you can see in next to it's setting.

但是您可以设置一些增强功能.如果应用程序未运行,您可以强制自动构建 :

But you can set some enhancements. You can enforce automatically building if application is not running:

  • (自动构建,执行,部署/编译/构建项目)
  • 如果应用程序空闲了,则自动保存文件?秒

如果应用程序正在运行:例如,当您要运行Spring Boot应用程序时:

If application is running: For example when you want to run a Spring boot app:

  • 运行/调试配置/春季启动/运行应用程序更新策略:
  • 设置停用框架更新类和资源.因此,如果将焦点更改为IDE窗口之外,则项目将重新生成.
  • Run/Debug Configuration / Spring boot / Running Application Updates Policies:
  • Set for On frame deactivation to Update classes and resources. So if you change the focus to outside the IDE window, the project will rebuild.

如果您正在运行应用程序服务器,例如Tomcat:

If you are running an Application server, for example a Tomcat:

  • 您也可以将更新"操作设置为更新类和资源.在下面的链接中查看其工作原理.
  • You can set On 'Update' action to Update classes and resources too. See how it works in link below.

在IntelliJ中更新应用程序

这篇关于IntelliJ IDEA“自动构建项目"显然不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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