📜 ⬆️ ⬇️

Quick way to install Java Oracle on Ubuntu

Hi, habrovchane!
The network has enough information on installing Java Oracle. But, in my opinion, the method described below is the most convenient. The reason for convenience is that you don’t need to go to the Oracle website, register and download the installation file, and at the same time there is no need to store it somewhere locally.
The installation process is reduced to running a single script.

#!/bin/bash Version="x64" #  i586 JDK_URL="http://download.oracle.com/otn-pub/java/jdk/6u32-b05/jdk-6u32-linux-$Version.bin" wget --progress=bar --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" "${JDK_URL}" chmod +x jdk-6u32-linux-$Version.bin yes | ./jdk-6u32-linux-$Version.bin mkdir -p /usr/lib/jvm/ mv jdk1.6.0_32 /usr/lib/jvm/ for binary in $(ls /usr/lib/jvm/jdk1.6.0_32/bin/j*); do name=$(basename $binary) update-alternatives --install /usr/bin/${name} ${name} ${binary} 1 update-alternatives --set ${name} ${binary} done rm "jdk-6u32-linux-$Version.bin" 


If you need a 32-bit version, then you just need to replace in the script the value of the Version variable from x64 to i586.
I hope the script will be useful.

')

Source: https://habr.com/ru/post/160453/


All Articles