How to Install JDK 8 (Java 8) In Linux

preview_player
Показать описание
01) Download Orale JDK 8
//Link

02) Open Your Terminal(Ctrl + alt + T)

03) cd Downloads

04) sudo mkdir /usr/lib/jvm

05) cd /usr/lib/jvm

07) sudo gedit /etc/environment
(if your computer haven't gedit.. install using this command (sudo apt-get install gedit) )

08) After opened file,add followings command in your variable file

/usr/lib/jvm/jdk1.8.0_271/bin
/usr/lib/jvm/jdk1.8.0_271/db/bin
/usr/lib/jvm/jdk1.8.0_271/jre/bin

J2SDKDIR="/usr/lib/jvm/jdk1.8.0_271"
J2REDIR="/usr/lib/jvm/jdk1.8.0_271/jre"
JAVA_HOME="/usr/lib/jvm/jdk1.8.0_271"
DERBY_HOME="/usr/lib/jvm/jdk1.8.0_271/db"

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk1.8.0_271/bin:/usr/lib/jvm/jdk1.8.0_271/db/bin:/usr/lib/jvm/jdk1.8.0_271/jre/bin"
J2SDKDIR="/usr/lib/jvm/jdk1.8.0_271"
J2REDIR="/usr/lib/jvm/jdk1.8.0_271/jre"
JAVA_HOME="/usr/lib/jvm/jdk1.8.0_271"
DERBY_HOME="/usr/lib/jvm/jdk1.8.0_271/db"

09) Save and close the file.

09) Enter Following commands in your Terminal

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_271/bin/java" 0

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_271/bin/javac" 0

sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_271/bin/java

sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_271/bin/javac

10) Verify the setup

update-alternatives --list java

update-alternatives --list javac

11)Check the Java Version

java -version
Рекомендации по теме
Комментарии
Автор

I WAS WORKING ON THIS FOR ABOUT 6 HOURS AND THEN YOU COME AND SAVED MY LIFE!! you're the best in my opinion ❤️

pigliamosche
Автор

Thanks so much for making this so simple.

siliconedge
Автор

Grandioso!!!... Muchas Gracias, encerio valoro mucho tu video y tu explicación, te lo agradezco.

suarezzuares
Автор

yo whats this banging tune my home boy!
SWAG!

gasmask
Автор

when i check java -version it says.
zsh: exec format error: java

stonedtech
Автор

Very Helpful BRO, , ,
After 8 hours later it will be working...
tnx bro

forever.
Автор

Much appreciated worked great, if you get errors with the commands make sure you update the jdk version in the commands and file as they change.

NYCsDuce
Автор

update: it worked i had to use both this tutorial and another

tanimhussain
Автор

fially man I spent 2 days and I am in the process of downloading java thank you for saving my life thank you thank you

wlachaineofficielle
Автор

bro I cant install update-alternatives, what should I do

abduxalilraxmonberdiyev
Автор

hello bro i downloaded the newer version of java 8 i.e. 8u341 so what should i change in the environment file to run java

aashishishere
Автор

THE FRICKING ORACLE WEBSITE FORCES ME TO MAKE AN ACCOUNT, BUT I CANNOT INSTALL JAVA WITHOUT IT

varganyamuvek
Автор

Nothing I do seems to work it still says I have version 11.0.14??
Correction. I figured it out. And this did help a ton.

exciteproductionstwo
Автор

Hey brother! I can't download this jdk8. Because it force me to login. Can you up this jdk to google driver and give me the list?? Save me please, i'm have tried for 3 days ;'(((

tuanvjppro
Автор

plz help cd: Downloads: No such file or directory

diginovo
Автор

BRO I WANT TO DOWNGRADE 11 TO 8..WILL THIS WORK

deepakkumar-bkrp
Автор

bash: /usr/bin/java: cannot execute binary file: Incorrect executable format



Help Spanish

x_nicco_x
Автор

I could only find/download "jdk-8u351-linux-x64.tar.gz". Unfortunately the folder "jdk1.8.0_351/db (jdk1.8.0_351/db/bin)" is missing What can I do?

hmeier
Автор

update-alternatives: error: alternative for java not registered; not setting
i am getting this error

ayaanlone