Setting environment variables (taking GRADLE_HOME as an example)
- Download the gradle zip from the gradle distribution website, here
- Extract it to a directory.
Windows
- Right Click My Computer
- Click Properties
- Click Advanced System Settings
- Click Advanced tab
- Click Environment Variables
- Click New... under User variables for <user>
- In Variable Name box type GRADLE_HOME, and in Variable Value box type <Gradle_Extracted_Directory>
- Click OK to save this variable
- Now scroll the list of User Variables and edit Path variable and at the end add %GRADLE_HOME%/bin by keeping semi colon(;) as a separator
- Click OK and come out of all the windows and your variable is set for GRADLE in Windows machine
Linux
- To get all the previously available environment variables
- $ set
- To get a specific value of the variable
- echo "$HOME"
- Setting the variable
- export PATH=${PATH}:${HOME}/bin
- Using the above command the variable is gonna set for a session
- As soon as the session is out the settings gonna reset
- To make things permanent for the user we have to edit the bash profile
- For editing the bash profile
- vi ~/.bash_proflle
- Append the path setting as follows
- export PATH=${PATH}:${HOME}/bin
- save it and exit (ESC + wq)
- To get all the previously available environment variables
Verifying the installation
No comments:
Post a Comment