Hello, I recently began to master this OS. If it was clear in Windows, where to prescribe environment variables (for Java, Gradle and Ant), then I have difficulties in Ubuntu. In the Acid documentation, it is written that you need to use the EXPORT command, but then after the session is completed, this variable flies. I understand that in order to register the variable in the ENV “Nasov” you need to specify it in some bash. But I really did not find a step-by-step instruction on the network (although I could not ask Guggle about what command to write to go to Bash and register the necessary variables. Please explain how to do it?
Answer 1, Authority 100%
ls ~
See there either .bashrc or .bash_profile
Open to change
nano ~ / .bashrc
At the end of the file to enter the necessary, for example,
export demo_env = success
Press Ctrl + x then Y and ENTER
After performing
source ~ / .bashrc
Answer 2, Authority 80%
There was an answer Here
- open the file / etc / environment
-
Record the necessary variables:
Export Var_Name = var_value