Sometimes you might need to run or debug a certain class with the main() method , without creating a dedicated run configuration. In this case, IntelliJ IDEA provides a temporary run configuration.
Temporary run/debug configuration is added to the list of available configurations and works same way as the permanent run/debug configurations. You can change its settings using the Run/Debug Configuration dialog box and optionally save it as permanent.
-
Select the desired class with the
main()method in the Project view or open it in the editor. - Do one pf the following:
- On the context menu, choose or .
- Press ⌃⇧R or ⌃⇧R⌃⇧F10 or ⌃⇧F10⌃⇧R or ⌃⇧R^ F9, ⌃F9 or ⌃F9^ ⇧ F10, ⌃⇧F10 or ⌃⇧F10.
IntelliJ IDEA creates a temporary configuration, which appears in the Run/Debug Configuration selector, when the run or debug session is over.
- In the Run/Debug Configuration selector, choose .
- In the Run/Debug Configuration dialog box, click the
button. - On the context menu of the editor or Project view, choose .