如何立即查看IntelliJ Idea项目树中的编译错误?
我想知道是否可以配置 IntelliJ Idea 以立即显示项目树中的类文件的编译错误。目前,如果无法编译类,我需要手动触发重新编译以查看类上的错误标记。
I'm wondering if it is possible to configure IntelliJ Idea to immediately show compile errors on the class files in the project tree. Currently I need to manually trigger the recompilation to see error marks on my classes if the class cannot be compiled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从 IntelliJ 12 开始,有一个选项可以根据源代码更改自动构建项目。在“设置”-->构建、执行、部署 --> “编译器”选中“自动构建项目”复选框。这将立即显示项目树中的任何编译错误。
As of IntelliJ 12 there's an option to automatically build your project upon source changes. In "Settings" --> Build, Execution, Deployment --> "Compiler" check the checkbox "Build project automatically". This will immediately show any compile errors in the project tree.
我在网上进一步搜索了有关此功能的信息。最后看来这个功能确实不可用。有一些关于这个主题的讨论,其中还提到了一些(在我看来)解决方法。我发现的最有帮助的讨论 在这里。
I did some further searches in the web about this feature. At the end it seems that exactly this feature is not available. There are some discussions about this topic where also some (in my point of view) workarounds are mentioned. The most helpful discussion I found here.
您可以像这样访问所有编译问题:
您将看到一个文件树和问题。另外,在底部工具栏上,您应该会看到一个名为“问题”的选项卡,其中也列出了所有内容。它不如 Eclipse“问题”视图那么容易使用,但也很接近了。
我使用的是 12.1.4 版本,但不确定此功能首先出现在哪个版本中。
You can access all the compile problems like so:
You'll see a tree of files and problems. Also, on the bottom toolbar, you should see a tab called "Problems" which lists everything as well. It's not as easy to use as the Eclipse "Problems" view, but it's close.
I'm on version 12.1.4, not sure what version this feature first came in, though.
对我来说,“禁用电源安全模式”就成功了。
For me, "disabling power safe mode" did the trick.
您可以尝试 IntelliJ 的 Eclipse 模式插件。它允许您在保存文件时进行增量编译:
http://plugins.intellij.net /插件/?id=3822
You might try the Eclipse Mode plugin for IntelliJ. It allows you to do incremental compile upon saving a file:
http://plugins.intellij.net/plugin/?id=3822