IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Path variables

Last modified: 17 May 2021

Path variables are placeholders that stand for absolute paths to resources that are linked to your project but are stored outside it. If you are working in a team, these absolute paths on the computers of your teammates may differ. With path variables, you can flexibly share your code so all the references to the linked resources are resolved properly as the path variables accept the values according to the configuration on each specific computer.

In IntelliJ IDEA, there are some pre-defined variables:

  • $USER_HOME$: stands for your home directory.

  • $PROJECT_DIR$: stands for the directory where your project is stored.

  • $MODULE_DIR$: stands for the directory that keeps module configuration files IML.

To configure path variables, in the Settings/Preferences dialog Ctrl+Alt+S, select Appearance & Behavior | Path Variables.

Path Variables dialog