Using Ubuntu 14.04, was trying to set simply JAVA PATH (that is where the saga began) now my system seems totally corrupted.
I initially edited the PATH in
etc/environment
(that is where my PATH seems to be) and also added a lineexport JAVA_HOME
.PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/jdk1.8.0_111/bin" export JAVA_HOME=/opt/jdk1.8.0_111
This seemed to work till it did not. It did not work seemingly because of some old versions of JVM that were conflicting/confusing.
Based on forum wisdom I edited
.bashrc
export JAVA_HOME= /opt/jdk1.8.0_111 export PATH= $PATH:$JAVA_HOME/bin
Probably there was some syntax error (or something).
Now I am getting all kinds of errors when I open a terminal:
bash: export: `=': not a valid identifier
bash: export: `/opt/jdk1.8.0_111': not a valid identifier
bash: export: `/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/jdk1.8.0_111/bin:/opt/jdk1.8.0_111/bin': not a valid identifier
Note: Duplicate jdk in path - this likely is because PATH both in .bashrc and environment.
Now I am unable to find/edit either etc/environment or .bashrc
@ubuntu:~$ sudo gedit /etc/environment
bash: sudo: No such file or directory
@ubuntu:~$ sudo gedit ~/.bashrc
bash: sudo: No such file or directory
Fixed this above issue Thanks @muru
My core problem seemingly is caused by multiple java versions but I have only JAVA version
$ sudo update-alternatives --config java
update-alternatives: error: no alternatives for java
My program is not finding JAVA_HOME
$ sudo service dse start
Java executable not found (hint: set JAVA_HOME)
$ echo JAVA_HOME
JAVA_HOME
~$ java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
What do I do now?