1

i have downloaded oracle javaSE from oracle website.

File Name :jdk-8u45-linux-x64.tar

had used command :

tar -zxf jdk-8u5-linux-x64.tar.gz -C /usr/lib/jvm

for extraction.

after this what procedure i should follow to install it.

gurpreet singh
  • 19
  • 1
  • 1
  • 2
  • your question is answered [here][1] [1]: http://askubuntu.com/questions/56104/how-can-i-install-sun-oracles-proprietary-java-jdk-6-7-8-or-jre – ashish May 23 '15 at 17:26
  • @gurpreet singh: Before you post a new question, please check out whether some sort of similar questions have already been posted, and hopefully with answers. – ashubuntu May 23 '15 at 17:32
  • when i execute code mention in above link...i get output as: update-alternatives: error: alternative path /usr/lib/jvm/jdk1.8.0/bin/java doesn't What should i do now?? – gurpreet singh May 23 '15 at 20:05

2 Answers2

3

mkdir if not present "/usr/lib/jvm" download package and type this comand from the download directory

tar -zxf jdk-8u5-linux-x64.tar.gz -C /usr/lib/jvm/jdk1.8.0_45

install java

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_45/bin/java 100

to check if java is installed type

java -version

if you have multiple java you need to configure it by

sudo update-alternatives --config java

enter the number you want the default java to be from the list

tyson
  • 31
  • 1
0

The easiest way to install Oracle java to Ubuntu is this. Run

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

You will get latest java 8.

Pilot6
  • 88,764
  • 91
  • 205
  • 313