I am new to ubuntu. I am trying to use java-8. Where I have already installed java-6 in my ubuntu machine. I just want to use java-8 from my terminal (for test purpose); not from all over my machine.
I want java-6 remains for all other software like eclipse. I heard to to so we can ubuntu terminal to export. So I am trying to do this -
$ export JAVA_HOME=/usr/lib/jvm/jdk8
$ export PATH=$PATH:$JAVA_HOME
after doing this when I type in terminal the fllowing command -
$ java -version
it gives -
java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11) Java HotSpot(TM) Server VM (build 20.4-b02, mixed mode)
I tried several ways but nothing is working for me.