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
For example if you create /bin folder in your $HOME, by default in Ubuntu it is added to you PATH.
But perhaps somebody better informed will help you here, sorry mate ;)
I wouldn't know what are your privileges and [corporate] network setup.
What are you trying to do anyway?
– catalesia Feb 21 '13 at 18:28cd /usr/lib/jvm/jre1.7.0_15/bin
./java
also, what output do you get on:
– catalesia Feb 21 '13 at 18:59whereis java
which java
java: /usr/bin/java /etc/java /usr/lib/java /usr/bin/X11/java /usr/local/bin/java /usr/local/java /usr/share/java
and/usr/local/bin/java
– siamii Feb 21 '13 at 19:12/usr/bin/java -version
firstyou can try to symlink to whatever works, e.g.
– catalesia Feb 21 '13 at 21:55ln -s /usr/bin/java $HOME/bin/java
. This is assuming that./java
command worked for you. (I assume the one in /usr/bin did)