How to add directory to classpath in an application run profile in IntelliJ IDEA?

To add a directory to the classpath in an application run profile in IntelliJ IDEA, follow these steps:

  1. In the Project pane, right-click the directory that you want to add to the classpath and select "Mark Directory as" > "Classes Root".

  2. In the "Run/Debug Configurations" dialog, select the run configuration that you want to modify.

  3. In the "Classpath" tab, click the "Add" button and select "Classes" from the menu.

  4. In the "Classes" dialog, select the directory that you want to add to the classpath and click the "OK" button.

The selected directory will be added to the classpath for the selected run configuration.

I hope this helps. Let me know if you have any questions.