I have a file that sets enviroment variables(JAVA_HOME, ANT_HOME...) I use for doing java programming related tasks. WHen I want to setup the new environment I type "source devenv" (devenv being the file that contains the new environment setup). I'm trying to create a shortcut that opens the gnome-terminal and automatically sets those variables, but I'm unsure how. I tried : "gnome-terminal --command="source devenv" with no success.
My devenv file :
#!/bin/bash
JAVA_HOME=./jdk1.6.0_21
export PATH=$JAVA_HOME/bin:$PATH
export ANT_HOME=./apache-ant-1.8.1
PS1="[jdkenvironment] \w @ "
/bin/bash
When I type echo $JAVA_HOME the following is printed :
thiago@thiago-laptop:~/jdk$ echo $JAVA_HOME
thiago@thiago-laptop:~/jdk$