Home / ENGLISH / Linux System / [Solved] How to install java 8 on Centos Redhat 6/7

[Solved] How to install java 8 on Centos Redhat 6/7

This article will help you to Install JAVA 8 (JDK 8u66) or update on your system. Read the instruction carefully for downloading java from Linux command line.

If you want to install java 7, please read this article: how to install java 7 con centos

Downloading Latest Java Archive

Download latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell.

For 64Bit

For 32Bit

Note: If Above wget command doesn’t not work for you. You can download from Official page and upload to your server by TFTP/FTP

Install Java with Alternatives

After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package.

At this point JAVA 8 has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives

Check Installed Java Version

Check the installed Java version on your system using following command.

Configuring Environment Variables

Most of Java based application’s uses environment variables to work. Set the Java environment variables using following commands

    • Setup JAVA_HOME Variable
    • Setup JRE_HOME Variable
    • Setup PATH Variable
Also put all above environment variables in /etc/environment file for auto loading on system boot.

(open /etc/enviroment and add 3 lines


About Hoang Do Viet

Check Also

How to fix error PYCURL ERROR 7 – Failed to connect to .. on Vmware Workstation Centos

Tuhocmang.com – [Discuss]: How to fix error PYCURL ERROR 7 – “Failed to connect to ..” …

Leave a Reply

Your email address will not be published. Required fields are marked *