I tried to export JAVA, used this
JAVA_HOME=/etc/jdk1.7.0_07/
export JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin
It seems like it works just for while, after I close my console have to do this again.. How to install it permanently.
@AdamSiemion is close - You should add these lines to ~/.bashrc
, which is sourced by interactive shells, while ~/.bash_profile
is only sourced by interactive login shells.
cat >> ~/.bashrc <<'EOF'
JAVA_HOME=/etc/jdk1.7.0_07/
export JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin
EOF
To verify, open a new shell and echo "$JAVA_HOME"
.
Append these lines to the .bash_profile
file in your HOME
directory, i.d. ~/.bash_profile
.