There are many - perhaps too many - places to set environment variables. Environment variables are part of the environment component of the command shell, and Linux has probably half a dozen major shells to choose from, with bash being the most popular, but also csh, ksh, zsh, and others being used as well.
The closes thing to the "system" environment in Windows is probably /etc/profile, which is a reference for all the major shells. Each shell generally maintains one or more profiles unique to that shell - for example ".bash_profile", which is a file in the user's home directory used to setup the environment for the bash shell. User-specific profiles are are "hidden" files, and the user-specific version of /etc/profile is "~/.profile", where "~" is the shorthand for the user's home directory as implemented in most popular shells.
When a shell or the desktop spawns a sub-shell, the spawning process has the option to propagate a copy of the parent shell to the sub-shell or to create a new, empty environment, Likewise, the spawning shell can request that the user's login script be executed or ignored, and the login script is what sets the user's initial environment at login.
All of this can get pretty complicated, but for basic purposes, you probably want an entry in the ~/.profile file such as this:
Depending on the shell, you may need to do the export as a separate command after you set the value. You must export the environment variable or it will only be in effect for the current shell.
An IDE is no substitute for an Intelligent Developer.
I was following the below instructions for Ubuntu 11.10
I was following these instructions :
The ~/.bash_profile ($HOME/.bash_profile) or ~/.prfile file is executed when you login using console or remotely using ssh. Type the following command to edit ~/.bash_profile file, enter:
$ vi ~/.bash_proflle
Append the $PATH settings, enter:
Save and close the file.
I entered the first command vi~/.bash_profile on the terminal and pressed ENTER.
The terminal now shows a blank screen with ~ at the beginning of every line & ~/.bash_profile [New File] at the bottom.
Now if i try to write anything then nothing appears in the terminal while the bottom line shows 'Nothing to register'.
Is there a way to open such file in Notepad and then append the line ?