Questions tagged [environment-variables]

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.

Environment variables are a set of dynamic-named values that can affect the way running processes will behave on a computer. They can be said in some sense to create the operating environment in which a process runs. For example, an environment variable with a standard name can store the location that a particular computer system uses to store temporary files—this may vary from one computer system to another. A process which invokes the environment variable by (standard) name can be sure that it is storing temporary information in a directory that exists and is expected to have sufficient space.

https://en.wikipedia.org/wiki/Environment_variable

13704 questions
225
votes
12 answers

Get Environment Variable from Docker Container

What's the simplest way to get an environment variable from a docker container that has not been declared in the Dockerfile? For instance, an environment variable that has been set through some docker exec container /bin/bash session? I can do…
Citronen
  • 4,050
  • 4
  • 16
  • 20
223
votes
9 answers

How can I get System variable value in Java?

How can I get the System Variable value which is present in MyComputer -> Properties -> Advanced -> Environment Variables -> System Variables in Java? Edit I have used System.getenv() method. It is printing value if I give…
raja
  • 4,043
  • 6
  • 30
  • 24
220
votes
6 answers

How can I permanently export a variable in Linux?

I am running RHEL 6, and I have exported an environment variable like this: export DISPLAY=:0 That variable is lost when the terminal is closed. How do I permanently add this so that this variable value always exists with a particular user?
user1340582
  • 19,151
  • 35
  • 115
  • 171
219
votes
26 answers

How to set Java environment path in Ubuntu

I just installed JDK in Ubuntu with sudo apt-get install openjdk-6-jdk command, after the installation where's the Java bin directory located? And how can I set the environment path for that directory? I have little experience with Ubuntu, can…
Ullas Prabhakar
  • 3,546
  • 3
  • 28
  • 27
216
votes
4 answers

Where are environment variables stored in the Windows Registry?

I need to access an environment variable remotely. To do this, I think the best way is to read it from registry. Where are environment variables stored in the Windows Registry?
Brian R. Bondy
  • 339,232
  • 124
  • 596
  • 636
212
votes
4 answers

How to set child process' environment variable in Makefile

I would like to change this Makefile: SHELL := /bin/bash PATH := node_modules/.bin:$(PATH) boot: @supervisor \ --harmony \ --watch etc,lib \ --extensions js,json \ --no-restart-on error \ …
bodokaiser
  • 15,122
  • 22
  • 97
  • 140
211
votes
21 answers

How to set ASPNETCORE_ENVIRONMENT to be considered for publishing an ASP.NET Core application

When I publish my ASP.NET Core web application to my local file system, it always takes the production-config and the ASPNETCORE_ENVIRONMENT variable with the value = "Production". How and where do I have to set the value of the…
dario
  • 2,861
  • 3
  • 15
  • 34
211
votes
6 answers

How to refer environment variable in POM.xml?

I am using maven as build tool. I have set an environment variable called env. How can I get access to this environment variable's value in the pom.xml file?
user1016403
  • 12,151
  • 35
  • 108
  • 137
210
votes
20 answers

How to test code dependent on environment variables using JUnit?

I have a piece of Java code which uses an environment variable and the behaviour of the code depends on the value of this variable. I would like to test this code with different values of the environment variable. How can I do this in JUnit? I've…
vitaut
  • 49,672
  • 25
  • 199
  • 336
205
votes
11 answers

setting an environment variable in virtualenv

I have a Heroku project that uses environment variables to get its configuration, but I use virtualenv to test my app locally first. Is there a way to set the environment variables defined on the remote machine inside virtualenv?
Mahmoud Hanafy
  • 7,958
  • 12
  • 47
  • 62
205
votes
10 answers

Environment variables in Mac OS X

Update: The link below does not have a complete answer. Having to set the path or variable in two places (one for GUI and one for shell) is lame. Not Duplicate of: Setting environment variables in OS X? Coming from a Windows background where it's…
Abdullah Jibaly
  • 53,220
  • 42
  • 124
  • 197
202
votes
14 answers

Using Environment Variables with Vue.js

I've been reading the official docs and I'm unable to find anything on environment variables. Apparently there are some community projects that support environment variables but this might be overkill for me. So I was wondering if there's something…
Edgar Quintero
  • 4,223
  • 2
  • 34
  • 37
202
votes
9 answers

Setting environment variables via launchd.conf no longer works in OS X Yosemite/El Capitan/macOS Sierra/Mojave?

It looks like the launchd.conf does not load my environment variable anymore. Has anyone else noticed that? Is there another solution to permanently set environment variables?
Tosh
  • 2,097
  • 3
  • 13
  • 8
198
votes
5 answers

What is the difference between user variables and system variables?

What is the difference between user variables such as PATH, TMP, etc. and system variables? I accidentally deleted the user variable PATH. What am I supposed to do?
rookie
  • 7,723
  • 15
  • 49
  • 59
198
votes
11 answers

How to set env variable in Jupyter notebook

I've a problem that Jupyter can't see env variable in bashrc file. Is there a way to load these variables in jupyter or add custom variables to it?
Ehab AlBadawy
  • 3,065
  • 4
  • 19
  • 31