Intellij Idea not showing errors in Message Tool Window after Gradle build
Asked Answered
V

4

18

Intellij Idea 14.1.2, Gradle 2.3

I have a project with few java subprojects. Gradle builds works as expected but Intellij Idea does not capture the output of it and does not show the Messages Tool Window where you can click on the error and go to the source file.

Steps to reproduce:

  1. Create new gradle project
  2. Create new class with one method
  3. Introduce intentionally one error
  4. Build using Gradle tool window

Expected result: Message Tool window will show up showing the error.

Actual result: Output is shown in the Run tool window, but the Message window is not shown (it's menu item is not even active in View -> Tool windows)

I've tryed to reimport the project, to create it from scratch, searched Idea's settings, manipulated manually values in *.iml but with no success and I am running out of ideas.

Any idea where I can find a setting that tells the IDE to direct output to the Messages window?

Vampirism answered 4/5, 2015 at 18:34 Comment(0)
B
30

In Intelij 16.2 I had this problem as well. In the top left corner of the "Run" window there is an odd looking button that when you mouse over is labeled "Toggle tasks executions/text mode." Click it and it will show you the output from the Gradle build instead of the steps in the task execution.

Borderer answered 4/8, 2016 at 16:24 Comment(4)
I had the same problem in IntelliJ 16.2 but found the button described "Toggle tasks executions/text mode" on the left side of the Run window.Electrokinetic
Using this trick I can now at least see the errors in Intellij... but the messages window is still not show. Thus the errors are not click able.Terpene
Where are you seeing the errors if not in the message window. That is where they come up for me.Borderer
@Borderer Thanks -- your suggestion helps because it shows the command line error output. However, it doesn't show the error listing that I was used to seeing in IntelliJ 2016. Now that I'm using Gradle 3.4 and IntelliJ IDEA Community 2017.1, I don't have a nice way to browse all project-wide compilation errors.Geometrician
F
13

I had this problem on IntelliJ 2017.1, as well. The answer posted by BrianC on Aug 4 '16 helped me--however I found the button on the opposite side--on the left side of the Run window, therefore I am posting an image with the exact button.

When you hover over this button, it says 'Toggle tasks executions / text mode'. The image shows the button when selected.

'Toggle Tasks Executions' button

Fa answered 26/5, 2017 at 22:18 Comment(0)
V
6

Finally found the solution:

For some reason when creating gradle project or module Idea does not add automatically the java-gradle facet.

In order to get the errors in the Message Tool window you will have to add it to your module(s) like this:

File -> Project structure -> Facets

Click on the plus sign, select Java-gradle, select module, OK.

Please note that if you start the build from the Gradle tool window (the right side pane) errors will not be shown in the Message window. You will have to use the "normal" build in the IDE, e.g. Build -> Compile module.

Vampirism answered 5/5, 2015 at 6:36 Comment(0)
Y
0

I had a very similar issue in 2019.2.* where if I had previous results in the run tool window and then did a gradle build and had errors, it would switch me to the run tool window instead of the build window. This looks to be fixed in 2019.3.*.

Yesterday answered 17/12, 2019 at 19:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.