Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Configuration how-to"

(New page: Loading Remote Environment Variables for a Synchronized Project * An environment variable is a named value associated with a terminal session. Values take the form of strings, but numeric...)
 
m
 
Line 13: Line 13:
 
** <tt>export PATH=$PATH:$HOME/bin</tt>
 
** <tt>export PATH=$PATH:$HOME/bin</tt>
 
* Environment variables can be set per session on the command line, but are not stored. To store them, one may define them in ~/.bashrc or ~/.profile so that they load on startup (the files ~/.bashrc and ~/.profile contain instructions which execute upon startup of a terminal session). If you change ~/.bashrc or ~/.profile and want to start a new session with its changes, use the command <tt>source ''[filename]''</tt>, as in <tt>source ~/.bashrc</tt> or <tt>source ~/.profile</tt>. If you are not using bash, then you will need to change the shell-specific configuration.
 
* Environment variables can be set per session on the command line, but are not stored. To store them, one may define them in ~/.bashrc or ~/.profile so that they load on startup (the files ~/.bashrc and ~/.profile contain instructions which execute upon startup of a terminal session). If you change ~/.bashrc or ~/.profile and want to start a new session with its changes, use the command <tt>source ''[filename]''</tt>, as in <tt>source ~/.bashrc</tt> or <tt>source ~/.profile</tt>. If you are not using bash, then you will need to change the shell-specific configuration.
 +
* Make sure the relevant environment variables are set on the proper machine (the machine to compile or execute the binary).
 +
 +
* Alternatively, environment variables may be set in the ''Environment'' tab [[lib.path.jpg within a run configuration]].

Latest revision as of 00:12, 5 January 2012

Loading Remote Environment Variables for a Synchronized Project

  • An environment variable is a named value associated with a terminal session. Values take the form of strings, but numeric values can be stored and manipulated as strings.
  • Environment variables are local to a terminal session; thus, if you change a variable in a terminal session, its changes affect only that terminal session. They are, however, inherited by child processes. Child processes cannot change environment variables associated with the parent.
  • Two important environment variables important:
    • PATH: paths to binary files. If you have installed software in user space, make sure you update your $PATH to include the path to those binaries; then you can call them from anywhere.
    • LD_LIBRARY_PATH: paths to shared libraries. If an application in your $PATH uses shared libraries not within $LD_LIBRARY_PATH, you'll need to set $LD_LIBRARY_PATH to include them. Otherwise you will get an error such as: "libsomething.so: could not find shared library"
  • The command for defining an environment variable is export VAR=VALUE, where VAR is the name of the environment variable and VALUE is the value.
  • After definition, environment variables may be referenced as $VAR, with a dollar sign ($) before the variable name. E.g. echo $VAR following the above definition will print VALUE.
  • E.g.:
    • export GREETING="Hello"
    • export PATH=$PATH:$HOME/bin
  • Environment variables can be set per session on the command line, but are not stored. To store them, one may define them in ~/.bashrc or ~/.profile so that they load on startup (the files ~/.bashrc and ~/.profile contain instructions which execute upon startup of a terminal session). If you change ~/.bashrc or ~/.profile and want to start a new session with its changes, use the command source [filename], as in source ~/.bashrc or source ~/.profile. If you are not using bash, then you will need to change the shell-specific configuration.
  • Make sure the relevant environment variables are set on the proper machine (the machine to compile or execute the binary).

Copyright © Eclipse Foundation, Inc. All Rights Reserved.