Question:
how to set environment variables in LINUX?
TeD BuNdY
2008-12-30 04:39:42 UTC
i recently downloaded a tool (apache ant)

in the manual i find two instructions which i am not getting. please help me with them

1. Set the ANT_HOME environment variable to the directory where you installed Ant.

2. set the JAVA_HOME environment variable

now my question is
how to set these variables..

please explain me with commands

thanks for answering.
Four answers:
2008-12-30 04:44:43 UTC
ANT_HOME=/some/location ; export ANT_HOME

JAVA_HOME=/some/other/location ; export JAVA_HOME



You can add them to ~/.bashrc so they're added every time you login.
canizares
2016-10-25 08:19:55 UTC
if you're placing variables in a script and then attempting to study them contained in the shell that released the script, it gained't artwork. you could make the variables international by utilising, e.g. "export x=2", yet this in effortless words makes them accessible to newborn techniques/sub shells of the script, no longer the figure shell. i do no longer imagine there is any thanks to bypass variables from a newborn shell to a figure shell. there could be yet in a special thanks to achieve the same result utilising a diverse technique. i'm no longer quite an expert in this, in spite of the indisputable fact that, so i'm unable to furnish a lot suggestion.
2008-12-30 04:49:43 UTC
http://www.notebooks4free.com/default.aspx?r=1271210
Sathish G
2008-12-30 04:49:02 UTC
The system files are /etc/csh.login and /etc/csh.cshrc Your own files are .tcshrc, .cshrc and .login

The commands for tcsh corresponding to the above ones are as follows:



setenv PATH /usr/bin:/bin:/usr/local/bin:$HOME:.

setenv LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/home/pablo/lib


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...