How to copy error out to clipboard from IntelliJ

2019-01-23 12:22发布

问题:

I am seeing an error in this yellow box in IntelliJ. How to copy it out to system clipboard?

In Eclipse, there is a good way of doing so. How to do this in IntelliJ?

回答1:

The following approach works for me on Windows 8.1 and IDEA 14.1:

Move the caret to the error location. The error message appears on the left side of the status bar below. Right-click the error message - a context menu containing a command "Copy" appears. Select the command "Copy". Voila, the error message is in the clipboard.



回答2:

Long-awaited solution for Linux version: press Ctrl+Alt+left mouse button on the tooltip - and you've got it in your clipboard :)

The solution doesn't seem to be documented anywhere (correct me if I'm wrong), although it works nice.



回答3:

When the tooltip appears - select the text with the mouse, but hold the mouse button down until you press Ctrl+C. This works for me with IntelliJ 13.1 on Ubuntu 14.04.



回答4:

On the right side of an editor field you can see a red mark that represents your error in the line. If you hover over it, you see the same message tooltip. Quickly move over it and press the mouse button to select the text. It worked in my case.

I have the feeling that this tooltip is a lot easier to select than the tooltip that appears if you hover over the text!



回答5:

There isn't an easy way to select the tooltips' text, from my experience, and paste it somewhere else.

Note, however, that depending on what you're analyzing, and the type of error you're getting, the information can be gleaned from the Inspections tool.

Even that won't provide context for you; in this case, the output you're seeing is equivalent to what you'd get if you compiled the Java class. In that case, you'd see the output in the Make window instead.



回答6:

@Vladimir's solution didn't work for me, what I did is just rebuilding the project and copying the error from the message window.