Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install JDK from tar.gz Ubuntu
#Login as root
sudo su
#create jdk directory
mkdir /opt/jdk
#uncompress, change to your file name
tar -zxf jdk-8u5-linux-x64.tar.gz -C /opt/jdk
#check if files are there
#ls /opt/jdk
#update alternatives so the command java point to the new jdk
update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_05/bin/java 100
#update alternatives so the command javac point to the new jdk
update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_05/bin/javac 100
#check if java command is pointing to " link currently points to /opt/jdk/jdk1.8.0_05/bin/java"
update-alternatives --display java
#check if java command is pointing to " link currently points to /opt/jdk/jdk1.8.0_05/bin/javac"
update-alternatives --display javac
#check if java is running
java -version
@imzoughene
Copy link

imzoughene commented Apr 8, 2018

thanks

@NoeVG
Copy link

NoeVG commented May 11, 2018

thanks 👍

@ynsmtkl
Copy link

ynsmtkl commented May 29, 2018

thanks, steps more clear than oracle website 👍

@maxzap
Copy link

maxzap commented Jun 22, 2018

thanks!

@dsatul
Copy link

dsatul commented Jun 26, 2018

Thanks

@Fabio-Drunn
Copy link

Fabio-Drunn commented Jul 18, 2018

valeu!!

@elyess78
Copy link

elyess78 commented Jul 18, 2018

thanks,very useful!!

@fahamjv
Copy link

fahamjv commented Aug 18, 2018

root@GHOST:/home/batman/Downloads# java -version
bash: /usr/bin/java: cannot execute binary file: Exec format error
root@GHOST:/home/batman/Downloads#

what should i do ?

@jsalvad0r
Copy link

jsalvad0r commented Nov 30, 2018

thanks buddy

@abdhx
Copy link

abdhx commented Dec 18, 2018

You saved my life! thanks

@peterwilli
Copy link

peterwilli commented Dec 26, 2018

Also works on Debian 9.6 :)

@ant-rod-silva
Copy link

ant-rod-silva commented Dec 27, 2018

Thanks!!! Working on Ubuntu 12

@claudiopmaia
Copy link

claudiopmaia commented Jan 26, 2019

thanks

@LongClipeus
Copy link

LongClipeus commented Apr 19, 2019

thanks

@byhankim
Copy link

byhankim commented May 4, 2019

You saved my day. Thanks!

@derrickpeavy
Copy link

derrickpeavy commented May 16, 2019

Awesome! Thank you!

@llinuxde
Copy link

llinuxde commented Jun 26, 2019

thanks! works well on Debain 9

@mdradityatama
Copy link

mdradityatama commented Aug 7, 2019

thanks

@shoniisra
Copy link

shoniisra commented Aug 27, 2019

It could be the last step if your java version doesn't change (show and choose from list alternatives)
sudo update-alternatives --config java

@anjali965
Copy link

anjali965 commented Apr 15, 2020

Thanks ,It worked :)

@amieldanao
Copy link

amieldanao commented Apr 29, 2020

Thank you

It could be the last step if your java version doesn't change (show and choose from list alternatives)
sudo update-alternatives --config java

Thank you

@DevStark22
Copy link

DevStark22 commented May 3, 2020

Thanks men !

@henriquecalasans
Copy link

henriquecalasans commented May 15, 2020

Thanks!! man

Copy link

ghost commented Aug 25, 2020

Thanks man. very helpful

@romec512
Copy link

romec512 commented Sep 21, 2020

👍

@Humeid-Ussene-Jocordasse

Voce merece um abraço irmão

@sauron34
Copy link

sauron34 commented Aug 11, 2021

Thank you very much!

@Lubrum
Copy link

Lubrum commented Sep 20, 2021

Thanks :D (from Dom Pedrito - RS - Brazil)

@PepeDahPhrog
Copy link

PepeDahPhrog commented Dec 15, 2021

Thank you very much, you need a monument !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment