[ubuntu] Setting env. variables - what's the right way?

view story

http://ubuntuforums.org – I have tried to get some variable through Java (System.getenv()) which was set inside ~/.bashrc It hasn't appeared in the list of variables. Than, I've added script.sh with it's variable declaration to /etc/profile.d/ and everything has worked perfectly. This is what mighty Google has found: Quote: Application Environment Setup Using /etc/profile.d/* When a user logs in, environment variables are set from various places. That includes /etc/profile (for all users). Then all the files in the /etc/profile.d directory. Then ~/.bash_profile, then ~/.bas (Hardware)