在IntelliJ Idea中设置和使用环境变量 [英] Setting up and using environmental variables in IntelliJ Idea

查看:871
本文介绍了在IntelliJ Idea中设置和使用环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个环境变量(在 IDE设置 - >路径变量

  APP_HOME = / path / to / app_home 

我的一项测试失败但是with

  System.out.println(APP HOME:+ APP_HOME); 

使用

  APP HOME:null / 

看起来好像没有读取env变量。我缺少什么?

解决方案

路径变量对话框与环境变量无关。 / p>

环境变量可以在您的操作系统中指定,也可以在运行配置中自定义:




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

 APP_HOME = /path/to/app_home  

One of my tests is failing however with

 System.out.println("APP HOME: " + APP_HOME); 

With

 APP HOME: null/ 

It does not look like that env variable is being read. What am i missing?

解决方案

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:

这篇关于在IntelliJ Idea中设置和使用环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆