Go to Next Error

Quickly move to the next (or previous) error or warning in the file.

When you open a source file in the editor, you may see warnings or errors in this file. You can quickly step through to check all these issues without having to use the mouse, just press F2 (macOS) / F2 (Windows/Linux).

While you're coding, you may want to jump to the next error or warning F2 (macOS) / F2 (Windows/Linux) or the last one ⇧F2 (macOS) / Shift+F2 (Windows/Linux). This way, you can quickly hop to the next thing that needs fixing or addressing without having to move your hand to the mouse.

Combine this with Alt+Enter (Windows/Linux) to quickly see the suggested solution to the problem and apply a fix. This will show a list of suggested solutions, as we saw in the tip about Context Actions, and we can pick the solution that suits us best.

If you're confident IntelliJ IDEA has the correct fix for the problem, you can skip the step of listing the solutions. Press F2 (macOS) / F2 (Windows/Linux) to navigate to the problem, then press ⌥⇧⏎ (macOS) / Shift+Alt+Enter (Windows/Linux), to accept IntelliJ IDEA's suggested fix.

Accept suggested fix

Related Resources

Context Actions
Use Alt+Enter to show available context actions
Inspections Widget
The top-right corner of your editor shows you information about the state of your class
Convert class to record
Use inspections to convert classes to Java 16 records