System.getenv()无法获取在IntelliJ IDEA中设置的替代参数

时间:2019-04-04 07:47:11

标签: intellij-idea environment-variables

我在IntelliJ IDEA运行/调试配置中设置了一个环境,如下所示:

enter image description here

我正在尝试在代码运行时获取环境值,但是它返回null

enter image description here

为什么它不返回cfc

1 个答案:

答案 0 :(得分:0)

documentation for Spring Boot Run/Debug Configuration描述了 Override参数用于:

  

使用此表来指定要覆盖的Spring Boot配置参数。这些参数通常在配置文件中定义。

要定义操作系统环境变量,请使用环境变量框。