Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have an aplication that requires me to define a certain environmental variable (the application is eclipse a java IDE and the variable is MOZILLA_FIVE_HOME). If this variable is not defined in the scope of the application when it is run it causes errors.
I've discovered that executing the following two lines in a shell
sets the enviromental variable. I can then open my application from the shell without errors.
The question is that instead of having to always do this and open my app from a shell i'd like to permanently define this enviromental variable (for all users) in a scope that will allow me to open the app from, say, a desktop icon or launch menu.
What vital piece of info am i missing, hope someone can help.
reddazz's solution only works for your user. If you want it to work for all users, put reddazz's
command in /etc/profile instead of your .bash_profile.
Thanks for both your responses but unfortunately niether of them exported the variable inside a Gnome environment.
From what i've been able to find out the problem is that when you start a new xsession no bash login is performed and hence neither /etc/profile nor .bash_profile are executed.
The solution that i have found is to create a local profile script:
/etc/X11/Xsession.d/999local-profile
with the export command in it.
This does get executed and everything works fine however i'm pretty new to linux and don't know much about the xsession startup procedure or standard conventions. I've named the script 999.... because i read somewhere that it would execute last in the startup scripts, is this correct or is there a better standard way to export variables for an xsession?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.