How to Install JAVA 7 (JDK 7u79) on CentOS/RHEL 7/6/5 and Fedora

During installation of Java using rpm files I faced issues many times. After that i found a better way to install java from Sun site. Using below steps i have installed java successfully many times without facing any issues. We can also install multiple version of java easily if required. Oracle has also released Java 8. To install it read article

Use following step by step instructions to install or update Java. I recommend to read carefully instruction for downloading Java from Linux command line.

Downloading Latest Java Archive

Java latest archive is available on its official site. We recommend to download latest version of Java from Oracle official website. After completing download also extract archive with given commands.

For 64 Bit:-

For 32 Bit:-

Note: If Above wget command doesn’t not work for you watch this example video to download java source archive using terminal.

Use archive file as per your system configuration. For this example we are using CentOS 7.0 (64 bit) system.

Install Java with Alternatives

After extracting Java archive file, we just need to set up to use newer version of Java using alternatives. Use the following commands to do it.

Now you may also required to set up javac and jar commands path using alternatives command.

Check Installed Java Version

Use following command to check which version of Java is currently being used by system.

Configuring Environment Variables

Most of Java based application’s uses environment variables to work. Use following commands to set up these variable properly. It’s also good to add following commands to any start-up script like ~/.bashrc or ~/.bash_profile.

    • Setup JAVA_HOME Variable

    • Setup JRE_HOME Variable

    • Setup PATH Variable

I hope above steps will help you for installing Java on your Linux system. You can follow above steps to install multiple version of Java as same time but you can use only one version at a time.

Categories: 未分类

0 Comments

Leave a Reply

Avatar placeholder

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