AddThis Feed Button

Monday, June 13, 2011

Setup Environment Varibles for Windows , Unix , Linux, LUM Platforms

Share |

Environment variable are the one whose value gets automatically set to our desired value on system start up or shell start up We often need to set environment variables on Windows, Unix , Linux, LUM Platforms. Here are simple steps to setup environment variable values on various operating systems.

Windows Platforms:
  • On your desktop or File Explorer you can find My Computer (Note: it should not be the shortcut but actual My Computer), right click on that and click on Properties in the content menu
  • Go to Advanced tab, click on Environment Variables button which show following UI
  • If you want to create environment variable for you user only then add it in top section and to create it system wide add it in bottom section.

Unix, Linux, LUM Platforms
  • For all Linux, Unix flavors, you can go to you HOME director, there you can find hidden file named .profile or else to set environment variable for all the users make entry in /etc/profile but this requires super user permission
  • Open .profile file in any editor and make entry to set the variable and export the variable for example if you want to set JAVA_HOME you can add following line to .profile file
        export JAVA_HOME
  • The save this file and restart the shell, you can find the environment variable automatically set.

Share |