Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Ubuntu 10.10

When I log in using normal GUI desktop, it seems that the environment is not the same with the terminal.

I modified $PATH and other information in .bashrc. But, this doesn't apply to the GUI session.

The actual problem is like this:

  • I made a shortcut to Eclipse on Ubuntu desktop. When I click it, it complains it can't find JVM path.
  • But, launching Eclipse from the terminal is okay.

How can I solve this problem?

share|improve this question

There are three recommended ways:

Session-wide environment variables

Environment variable settings that should affect just a particular user (rather than the system as a whole) should be set into:


System-wide environment variables

Environment variable settings that affect the system as a whole (rather than just a particular user) should not be placed in any of the many system-level scripts that get executed when the system or the desktop session are loaded, but into


Launching desktop application with an environment variable

You can add an environment variable to an application by editing its .desktop file. For example, to run "digiKam" with the environment variable APPMENU_DISPLAY_BOTH=1, find the corresponding digikam.desktop file and add the setting of the variable, via the env command, to the entry "Exec":

Exec=env APPMENU_DISPLAY_BOTH=1 digikam -caption "%c" %i

You should read this article and decide which method best suits for your needs:

Ubuntu Community Wiki: Environment Variables

share|improve this answer
/etc/profile too – technosaurus Feb 21 '13 at 3:28
@technosaurus: That's what I thought, too, but it is specifically not recommended by the referenced Ubuntu article. – garyjohn Feb 21 '13 at 6:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .