The KDE desktop environment supports environment variables. These are active when logged in to KDE. Contrary to regular bash environment variables, which are active only when a bash shell is started.

To set KDE environment variables create a file in the .kde4/env or .kde/env directory, e.g. as follows:

export MOZILLA_FIVE_HOME="/opt/firefox"