I have a java application which runs on a linux machine many times at a single login. At the beginning of it, I need to set some environment variables for further use. I did that by appending my variables and their values at the end of both ~/.bashrc
and ~/.profile
files.
In order to make those variables permanent, I should call "source ~/.bashrc
" or "source ~/.profile
". The problem here is that the source command can not be called through java because of it's scope concerns.
In a single word: How can I set permanent environment variables on my linux machine at the begining of my java application?