So java -version give path not found. I have tried the following: Edit:
~/.bashrc
~/.profile
/etc/environment
bash.bashrc
files and add to them the following:
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_15
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
JRE_HOME=/usr/lib/jvm/jre1.7.0_15
PATH=$PATH:$HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
In addition, I also manually added the java bin directory to PATH.
PATH="/usr/lib/jvm/jre1.7.0_15/bin:/usr/lib/jvm/jdk1.7.0_15/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/games"
I have restarted my computer several times but I still get
bash: /usr/local/bin/java: No such file or directory