Setting up and using environment variables in IntelliJ Idea

前端 未结 3 1015
再見小時候
再見小時候 2020-11-28 08:49

I set up an environment variable (Under IDE Settings -> Path Variables)

 APP_HOME = /path/to/app_home  

One of my tests

相关标签:
3条回答
  • 2020-11-28 08:54

    Path Variables dialog has nothing to do with the environment variables.

    Environment variables can be specified in your OS or customized in the Run configuration:

    env

    0 讨论(0)
  • 2020-11-28 08:58

    In addition to the above answer and restarting the IDE didn't do, try restarting "Jetbrains Toolbox" if you use it, this did it for me

    0 讨论(0)
  • 2020-11-28 09:16

    It is possible to reference an intellij 'Path Variable' in an intellij 'Run Configuration'.

    In 'Path Variables' create a variable for example ANALYTICS_VERSION.

    In a 'Run Configuration' under 'Environment Variables' add for example the following:

    ANALYTICS_LOAD_LOCATION=$MAVEN_REPOSITORY$\com\my\company\analytics\$ANALYTICS_VERSION$\bin
    

    To answer the original question you would need to add an APP_HOME environment variable to your run configuration which references the path variable:

    APP_HOME=$APP_HOME$
    
    0 讨论(0)
提交回复
热议问题