JShell

Use JShell in IntelliJ IDEA to quickly evaluate Java expressions.

JShell is a java REPL tool introduced in JDK 9. You can use it to interactively evaluate Java expressions quickly, without any overhead.

Open JShell in IntelliJ IDEA either from the main menu Tools | JShell Console, or by using Search Everywhere ⇧⇧ (macOS) / Shift+Shift (Windows/Linux) and looking for JShell Console.

Type your Java code in the JShell Console tab, and press ⌘⏎ (macOS) / Ctrl+Enter (Windows/Linux) to run this code in JShell. You will see the output of your code in the Run tool window.


Related Resources

Create a new class
Create a new class
Create a new class and a new package.
Endpoints tool window
Endpoints tool window
Work with endpoints to your application in a dedicated tool window.
Fix all in file
Fix all in file
Fix all occurrences of the same problem in the file.