Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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:

~/.pam_environment

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

/etc/environment

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.